Default E-form Field Values
E-forms have a built-in mechanism to auto-populate fields with data from the current Record. Knowing how the system will default E-form field values will help you design more efficient forms for your users.
How Auto-Fill Works
The behavior of the auto-fill logic works in 2 phases, and both phases are based on the NAME of the field. When the E-form loads, the system looks at every field in the form and applies the 2-phase logic. Phase 1 refers to Record Data and phase 2 refers to Form Data.
Phase 1 – Record Data: If that field name matches the name of a Record data field available in the current Record, then the Record data value will be brought into that field. If no match is found, the system applies phase 2.
Phase 2 – Form Data: If that field name matches the name of data that has been saved by any other E-form in that Record, then the last value saved will be brought into that field. If no match is found, the system will leave the field blank.
For example, if you have a field on your form named “LastName” then when you start a new form of that type, the system will see if there is data in the Record named “LastName.” If there is, that Record field’s value will be placed into the E-form field. If there was no matching Record data, the system looks to see if any other forms have saved a value with the name “LastName.” If so, then the LAST value that was saved with that name is placed into the E-form field.
Think of the Form Data as a list of the last saved values for each field name. Only the value per name saved is available for subsequent forms to use.
Changing the Behavior
If you would rather use the saved last Form value instead of the Record’s value, then you can change to that behavior. Or if you don’t want to auto-fill at all then you can do that too. In the Data Settings panel for your field, you can use the “Where to Get Initial/Latest Value” setting to control the order of the default value. The options are:
- Do Not Set – Do not try to auto-fill this field
- Record Data Only – Auto-Fill only from the Record data
- Form Data Only – Auto-Fill only from the Form data
- Record / Form Data – Auto-fill from the Record data but if no match then from the Form data
- Form / Record Data – Auto-fill from the Form data but if no match then from the Record data
The default setting is to auto-fill from the Record Data only. This is normally a good starting setting. However, if you save a lot of data to the E-form only and not to the Record then you may want to update the setting to load from Record / Form or Form / Record.
Always Use Latest Record / Form Value
A very useful option on auto-filling is the “Always Use Latest Record / Form Value” option. When this is turned ON, the form will try to auto-fill the field’s value EVERY time the form loads. This is very useful for instances where the form must display data that other forms or workflow processes would change after the form is saved. Examples would include the latest inventory amount for a part, the current status of vendor, etc.
Keep in mind that a field configured this way will not keep the value just for the form but rather will always show the latest value. If you need to keep a history of what THIS particular form saved, you should not use the “Always Use Latest Record / Form Value” setting.
Do Not Set Value / Compute Value
There are times when the field is meant to compute values to be saved rather than having previous values carried forward. You could do this by using variables in the Default Value setting for the field.
Let’s say you want to capture the current user’s Username for use in a later workflow step. You would do that by adding a field on the form and setting its Default Value to the “[Username]” variable. When the form first loads, [Username] will be replaced with the user’s Username dynamically.
However, if you still have the field’s “Where to Get Initial/Latest Value” setting set to load the field’s previous value from Record or Form, any computed value will be overwritten by the value from the Record or last form which is not what you want. In this example you need to set the “Where to Get Initial/Latest Value” setting to “Do Not Set Value / Compute Value” to stop the system from trying to fill it in with previously saved values and overwriting your dynamic value.
Closing Thoughts
The exact usage of these Data Settings depends on the outcome you require. Get to know how they work by experimenting with different combinations. It will be worth your while to take the time while testing – rather than on a live form.
Related Articles
Speeding Up E-form Loading: Part 1
Setting E-form Field Values Dynamically