Referencing Data Source Columns in Forms

Referencing Data Source Columns in Forms

The Form Designer allows you to link Choices fields to a Data Source that you have previously uploaded.

Data Sources can have as many columns as you like, and you may want to refer to the values in these columns when creating a Form.
To do so, you will need to use a formula to refer to the desired column.

By default, the first column in a Data Source (also known as the Value column) is always used as a field’s answer.
If you want to refer to any other column’s value, you need to use an index syntax – specifically, you need to add square brackets around the column’s index number – e.g., {{product[index]}}

Data Source column indexes always start at zero; i.e., the first column has an index of 0, the second column has an index of 1, the third column has an index of 2, and so on.

Let’s look at an example

Imagine you have a Data Source called “Products” that contains your product list, with rows such as:

You create a Form named “Sales Order” which you will use to capture orders for your products.

The Form has the following fields:

  • product_choice: A Choices field that is linked to the Products Data Source.
  • quantity: A Number field that captures the quantity of product ordered.
  • total: A Number field that will calculate the total amount by multiplying the product’s price by quantity.

On the “total” field, you would define a Dynamic Value formula as follows: {{product_choice[2]}} * {{quantity}}

Note the square brackets and index value of 2 used to refer to the 3rd column (the Price) in the Products Data Source.

    • Related Articles

    • Data Source Best Practices

      When using data sources, there are efficient and inefficient ways of structuring, binding, and storing your data. However, we’ll focus on efficient usage by establishing a few basics, how to structure your data, and best practices for specific ...
    • Creating Formulas in Forms

      Most advanced Form functions involve the use of a formula. As such, it is crucial that you understand how to create formulae to get the most out of our advanced features. Field Data Names The unique data name of a field can be referenced in other ...
    • Data Source Image Columns

      Data Sources allow you to specify columns containing a specific type of data, and Image is one of these types. This enables you to display images in the app in situations where rows of your Data Source are in use, for example as a thumbnail on each ...
    • Data Source GPS Columns

      To view a data source on a map, the data source must have at least one column with a type of “Geo Coordinate”. When the data source is saved, a new menu option will appear at the top of the page, as well as in the menu options when moving the cursor ...
    • Using Image Columns

      Data Sources allow you to specify columns as containing a specific type of data, and Image is one of these types. This enables you to display images on the app in situations where rows of your Data Source are in use. Examples would include a ...