Binding data to controls using static data

This article will guide you on different ways to bind static data to your controls

Binding Numeric Data

Numeric static data can be directly used in the formula box of any control. For example, if you want to assign a number say 9 to a number type control, then simply type 9 in the formula box, click Save.

numeric data

Binding Text or Characters

Text or characters can be directly used in the formula box of your control. For example, if you want to assign the name as DronaHQ to a string or text type control, then simply type the text in the formula box and click Save.

bind data formats

Binding List of Data

Data that is generally mapped to a list type controls viz. radio controls, checkbox, dropdown, multiselect, etc. are written in form of a list or group of data separated by a comma and put within square brackets i.e. [ ]. For example, if you want to assign static values for radio control say Gender having values - Male, Female, then you need to use the following format and write it in the formula box of radio control -

["Male","Female"]

image

Once you have filled the formula box with the desired static values, click on Save and Validate button and preview the app to check the corresponding radio control (as shown in the following image)

image

In the above example, both the values of radio control were not selected by default. To have a value selected by default when the app is displayed to the user, you need to assign that value in control’s formula modal under the Default Selected Value box (as shown in the below image). Once you mentioned the default selected value, click on Save and Validate button and check in the preview (as shown the image following the next image).

image

The following image shows how the option “Male” is displayed as the default selected value of the radio button.

image

Note, the Default Selected Value box in the formula modal is available for list-type controls viz. Multiselect, Radio, Checkbox, toggle_text, Select bar, Multiselect Bar, Keyword Box, Dropdown, File Upload.