How do I dynamically populate a form field, based on a selection 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 2: Master Data - Get the list column's field key
- Click on Edit list on the bottom of the master data list.
- Copy the field key displayed for the PastelCode list item to be used in the formula.
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.