Conditional Actions - Populate

Automatically Populate a Value Into a Field During Data Entry

Populating a field is a way of automatically inserting specific data into a field based on some condition. The data can be a static value/text or a value/text from another field.

The populate action will occur either when the form is opened up or based on the defined trigger event during data entry on the form. That event is in the "condition" portion of the conditional action.

Legacy forms require a trigger to execute populates after a form is opened up. Consider enabling the study for next-generation forms if you prefer improved experience with dynamic populate CAs.


Any field defined in the condition will be a "trigger" field. When a value in a trigger field changes, the event is checked by the system to populate the target field. Because of this, and similar to Hide and Disable conditional actions, events/conditions must be triggered during data entry by something a user is doing on the form. Populates are not run during form save or during version migrations.

Field types not supported include file uploads, signatures, scales and sliders.

If a field can potentially be populated differently for different scenarios, multiple populates can be written. In this example, we want to populate the current date into a date field if the user selects 'Yes' in some other field. If they select No, we want to clear any value that might exist.

To clear a field from a populate, simply leave the bottom target value empty as shown below.

 

Important points to consider:

  • A field type can only populate similar data. For example, if populating a date field, the source data needs to either be a date or come from another date field. In other words, a date field cannot be used to populate a text field.
  • Avoid nesting populate functions. In other words, If field A is getting auto-populated, do not populate field B based on Field A. Instead, populate the B using the same condition that caused field A to populate. In this way its not a nested action. If it needs nested, there must be some trigger used during data entry.
  • Formulas should not be used to populate a field. If a formula is needed, use a computation CA.

Populating a Multi-select field

If the targeted field is a Multi-select field, the populated value needs to be a "Number" with the coded values used. If there is more than one choice that needs to populate the field (multi-select fields), then separated values with commas should be used.

Alternatively, use the Choices field to select the choices that should be populated. This is also used in conditional choice CAs.

 

Clearing a Field's Data From a Populate Condition

You can use the Populate Value conditional action to clear a field. It processes the condition exactly the same way. However, if you want to clear the target field, do not enter anything into the formula editor. By leaving this blank, when the event is triggered by the user, the system will clear the field if the condition is true.

A simpler way to clear a value if it makes sense for the scenario is to make it hidden with a Hide type conditional action. 

Populate Upon Form Open

Populating can also be accomplished based on the form simply opening up, assuming the condition is true. Populating will be checked when a form is open or when a condition is met during data entry. Saving a form will not trigger populates.

----Note----

In legacy web forms, there must also be a "Manual" property set on the Conditional action for it to work when the form is first opened up. Without this, a trigger field will be necessary to make the populate get executed.

To create a Manual populate, simply enter the text "Manual" as the first part of the conditional action name as shown below.

Doing this is similar to a computed field. The following icon will appear next to the field and the condition will get checked automatically when a record is opened by a user.

manpopcaicon