How to use a Custom Button to increase a value

By using logic and rules in your form, you can use a Custom Button to increase a value. For example, in an inspection, you may need to keep track or count specific items. In this scenario, a Custom Button can be selected by a mobile user to increase a value and count items. This is one of many uses of incorporating a Custom Button into your form.

HOW TO SET UP A CUSTOM BUTTON TO COUNT

Step 1. Add a textbox into your form which will contain the item value.

Select the Textbox, and go to Logic > FIELD PROPERTIES, and make the Default Value '0' for the appropriate field; in this case, textbox1. Now, each time a new form draft is opened on your device, the Textbox value will now begin at zero

Step 2. Configure a Custom Button

After adding a custom button in your form, select it to see it's properties. Here you can change the label and style of the button, but for this example, select Logic > NEW RULE. In this scenario, I will create a rule so that each time I select the Custom Button, my Textbox value will increase by 1.

Leave all fields default besides the values under DO THIS:

Action - Set another field's value; this will happen when the button is selectedSet value of - Select the field that corresponds to your Textbox (in my case, textbox1)

The last thing you need to do is enter a number formula for the Custom Button:number(../textbox1) + number(1)

Note: Dropdowns Insert formula and Insert field are there to help create the action formula if needed.

Pictured above is an example of the counter button and value as seen on a device; each time the button is selected, the Number goes up by one