Getting Started with Salesforce Flow – Part 5 (Dynamic Flow Screen – What is Not to Love?)

Getting Started with Salesforce Flow – Part 5 (Dynamic Flow Screen – What is Not to Love?)

Last Updated on December 19, 2020 by Rakesh Gupta

Let us continue with my Salesforce Flow, ‘Getting Started’, series. A few months ago, I published an article to help you better understand Flow screen elements by taking a real-time example. In that blog, we discussed how to create a static Flow screen – A Static Flow screen always displays previously added fields. 

If you didn’t get a chance to read it yet, do it now! It will significantly improve your knowledge of Salesforce Flow. 

Let us take our knowledge of Flow a notch up! Let us learn how to create a dynamic Flow screen. 

Business Use Case

Edward Backhouse is working as a System administrator at GurukulOnCloud. Edward’s Manager requested him to create a form that looks like the following screenshot:
Screen Shot 2019-10-11 at 1.10.18 AM

Edward has to accommodate one more requirement – display a ‘Street’ field whenever the City is Mumbai; or else, don’t display the ‘Street’ field.

Screen Shot 2019-10-11 at 1.13.19 AM

Pause! Make sure you understand the requirements. Ready?

A solution for the above business requirement

If you are a Salesforce Developer, who knows how to create a Lightning Component, fulfilling the above requirement will be a breeze. But, if you don’t have development experience, it may be a nightmare! Even if you know how to write code in Salesforce, it is best practice to first try and see if you can conjure up a declarative solution.

Let us use Salesforce Flow and Screen Element to solve the above business requirement. Perform the following steps to create the solution using the new Flow Builder: 

  1. Log-in into your developer org. 
  2. Navigate to Process Automation Setting. Then select ‘In Lightning Experience, use the enhanced Flows page and separate Paused and Scheduled Automations page’ checkbox. The new enhanced Flows page in the Lightning Experience includes standard, and custom, Flows on a single page. Standard Flows are built by Salesforce; and, custom Flows are built by users or partners.
  3. Navigate to Setup (Gear Icon) | Setup | Process Automation | Flows.
  4. You’re now on the Flow management page. Based on your current org setting, you may see the following buttons: Lightning Flow 5.1
  5. Now click on the New Flow button, it will open a pop-up. Perform the following actions on the pop-up screen: 
    1. Screen Flow as Flow Types
    2. Once done, click on the Create button.Lightning Flow 5.2 Now it will redirect you to Flow Builder.
  6. Next, we will use the Screen element to create a form. Drag and drop a Screen element onto the Flow Builder. Then, follow the steps as shown in the video:
  7. The next step is to add another Text field to capture Street details to Screen Element. Drag and drop a Text input field onto screen element – Check out the video for step-by-step instructions:
  8. Add filter conditions, and logic to Street screen component’s field properties to show or hide it based on the value a user enters in the City field. Check out the video for step-by-step instructions:
  9. Once done, Save the Flow and name it Dynamic Flow Screenwith Type: Screen Flow. Do not forget to activate the Flow by clicking on the Activate button.Lightning Flow - 5.6
  10. Woohooo, you have just created a dynamic Flow using Flow Builder

It’s time to test the Process

From now onwards, if a user enters ‘Mumbai’ – as a value in the City field – then, the Street field will display. If anything, other than ‘Mumbai’, is populated in the City field then the Street field will be hidden!!  So, to experience the magic, click on the following video: 

I hope you learned something valuable today and understood how to dynamically display fields in Lightning Flow Screen! Who knew? that learning could be so much fun!! 

–> Please feel free to add constructive comments and insights to the blogs.

Proofreader: - Munira Majmundar
Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

2 thoughts on “Getting Started with Salesforce Flow – Part 5 (Dynamic Flow Screen – What is Not to Love?)

  1. Hi Rakesh,
    We have a requirement to have Dynamic Field visibility in a registration form based on selected country in community page. So we designed lightning flow with screen flow lookup component to list of available countries. In the screen flow added a lookup component with input fields of custom Product object that looks up to Country object which is custom object again.
    The flow with lookup works fine in SF record page but when added to community page record list Lookup is not shown but other flow components work fine. Please advice if you have any clue to come over this issue.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.