When a user is updating an existing record it’s often ideal to show an expected value for the fields instead of just a blank field. That expected value could come from the record itself, or you may have a calculation for the expected value.
Here are examples of date and text screen input field where the default values were retrieved from the record that is being updated in the flow:
As you can surmise, this can be really handy for the user, not to mention that the integrity of your data can be preserved and/or improved with this practice.
And luckily for admins this is easy to do with Input fields (in another post I’ll explore a solution for working with Choice fields).
How to Pre-Populate Input Fields
The first step is to get your data ready that will pre-populate the screen input fields.
This can take several different shapes:
- A constant – A constant you have defined in the flow
- A variable – A flow variable that has been set with a value
- A formula – A formula that calculates a value, or looks up a field value
- A reference to a field on a record
- Some text you type into the Default Value field
Here is an example of a formula that looks up a record’s field value. (This example shows a cross-object reference. For a little more about cross-object references see Cross-Object Field Referencing in Visual Flow.)
What I Tend to Use
I tend to use variables, and I will assign the screen input value back to the variable, then use the variable in the remainder of my flow. While there are many times when I could skip the step of putting a value into a variable prior to the screen element or putting the screen field value back into the variable after the screen element, I find that I have a little more flexibility with understanding, maintaining and updating the flow as well as keeping decision elements and formulas more streamline if I take these extra steps.
I’m also often branching to different screens where the same information is gathered in slightly different ways. After the information is received I put the input field values for each screen element into my variables, then use the variables going forward.
After you have a way to get your default value there is only one thing to do: Select your field then go to the Field Settings tab and enter the variable, formula, or reference (or just type some text) into the space where it says “Default Value”.
Coming up next…”Pre-Populating” Screen Choice Fields. This one isn’t as straight forward, but I have a workaround solution that is fairly acceptable.
Until then, Cheers!