1. Work with field items

Prefill fields values

You can prefill a field's value manually by using the configuration settings available in the right-hand pane of a form.

You can also populate specific values automatically using the following methods:

  • You can use data specified as parameters in the URL of the page that includes the form. For example, an end user is browsing for products on a website, and they want to request information for a specific product by filling in a form. The information of the product can be filled in automatically, because the user journey involving the form completion was initiated by a call to action on the specific product page.

  • You can use data stored as a JSON array and accessible via a URL. For example, you may want to add a list of check boxes with the name of various countries on your form. By using a JSON array, all fields will be filled by values and labels included in the array.

Automatically filling fields using existing data reduces the need for manual data entry by the end user, thereby also reducing the possible human errors. It enhances the end user experience by providing a seamless and intuitive way for users to integrate external data into forms, and ultimately contribute to higher rates of form completion.

Prefill a field with URL parameters

You can prefill a field's value with text saved as parameters in the URL of the page where the form is available. To do so, the end-user journey leading to the form completion must start from a specific page, where the data relevant to that page is included in the URL of the next page that contains the form.

For example, an end user is browsing for job openings on a website, and they want to apply to one of them by filling in a form. When the user clicks on a product manager job application submission, they are taken to a form included in a page whose URL includes the parameter ?role=productmanager. On that page, the job application form has a hidden field called role that will be populated by the value product manager, so you know for which role the applicant filled out the form.

This feature is available for all fields that can accept text, as well as for the Date field item. To prefill a Date field with a value, the format of the parameter in the URL must be ?data=yyymmdd.

Dynamic fields are not supported, meaning if you add to the url ?role=productmanager, it will always populate with this text in the role field. Also, query parameters values will overwrite any preexisting prefilled values for the field.

Prefill fields with external data source

You can prefill selected fields' options (values and labels) values, with data stored as a JSON array on a publicly available URL. This feature is available for the following field items:

  • Select and Multi select fields

  • Radio button and Checkbox fields

To use the feature, the data needs to be stored as a JSON array with key value pairs in the following format:

[{ value: 'option1', label: 'Option 1' }, { value: 'option2', label: 'Option 2' }]

For example, you might want to add a list of check boxes with country names on your form. In this case, your data source will look like this:

[{ value: 'Madagascar', label: 'MD' }, { value: 'Denmark', label: 'DA' }]

If your array includes only values or only labels, the string used for value will be used as label and vice versa.

To prefill a field's options using an external data source:

  1. In Forms, open the relevant form and click on the field item.

  2. On the right-hand pane, in the Options section, click Data source.

  3. In the Map data dialog, enter the URL where your data is stored.

  4. Click Check to check that the data provided is in the right format and enable the Save button.

  5. Click Save.

A value will be created in the field item for each value in the JSON array.

If needed, you can always add additional values manually with the Add option button. You can also use the Delete options button to start again.

If you have suggestions for improving this article, let us know!