Knowledge BaseHow to use Autopilot Process SetupHow do I dynamically populate a form field, based on a selection in another field?

How do I dynamically populate a form field, based on a selection in another field?

Autopilot uses JavaScript syntax to filter/populate field values based on a selection made in another field.  

In this scenario, we want to populate the Pastel Code field based on the Department chosen from the Department dropdown list. The same procedure will follow for any list and field.

Formula: form.utils.UpdateFieldValue("pastelcode", item.Properties.pastelcode, "string")- The colored text requires to be custom

  • pastelcode - the field key of the Pastel Code field. This will change accordingly based on the field you are using (Shown in Step 1 below)
  • item.Properties - the list where the data is being read from. THIS DOES NOT CHANGE.
  • pastelcode - The pastelcode field key from the master data list (ensure that this value is in small Caps - As shown in step 2)
  • string - The destination field (pastel code) data type

Step 1: Get the Field's Key of the form field

Step 1: Get the Field's Key of the form field

Click on the settings icon on the field. Copy the Field's key. that will be used in the formula.

Step 2: Master Data - Get the list column's field key

  1. Click on Edit list on the bottom of the master data list.
  2. Copy the field key displayed for the PastelCode list item to be used in the formula.

Step 3: Add formula to a Field

Step 3: Add formula to a Field

The formula will be linked to the field that is linked to the master data list. In this case, it would be the Department field. (Based on department, the Pastel COde field would be populated with data)

Click on the settings icon on the field.

Step 4: Adding the formula to the field

Step 4: Adding the formula to the field

Scroll to the bottom, and add your formula in the section available (As shown above)

Click on Save.