RSS

Pre-Populating Visual Flow Screen Input Fields

13 Nov
Pre-Populating Visual Flow Screen Input Fields

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:

Default Date Value

Default Date Value

Default Text Value

Default Text Value

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

First Step

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.)

Cross-Object Formula Field Reference

Cross-Object Formula Field Reference

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.

Different Screen Elements for Differing Input

Different Screen Elements for Differing Input


Last Step

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”.

Pre-Populated Text Field with Reference to Field

Pre-Populated Text Field with Reference to Field

Pre-Populated Text Field with Variable

Pre-Populated Text Field with Variable

Pre-Populated Text Field with Formula

Pre-Populated Text Field with Formula

Pre-Populated Text Field with Text

Pre-Populated Text Field with Text


Easy peasy!

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!

Advertisements
 
Leave a comment

Posted by on November 13, 2015 in Visual Flow

 

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: