You may have heard the old saying by Benjamin Franklin: “Nothing is certain in life but death and taxes”. I’m here to tell you that there are two more things I’m certain about… we all love Flow, and we all log in to Salesforce.
Today, we’ll learn how we can customize the Salesforce login experience using Flow.
Introducing Login Flow
Login Flow allows businesses to configure an enhanced login process across specific user groups. While not a new feature, login flow is something that not a lot of people are familiar with or actively using in their businesses.
The name is deceptive, as login flows can use both screen flows and visualforce pages. While this would’ve been helpful back in the day, it is a lot easier to embed a screen flow within the login process than a visualforce page, and a lot more customizable than it used to be.
Reasons for Custom Login Processes
Why would you want to change the way you login to Salesforce in the first place? Good question! Salesforce gives a few scenarios that you may come across in your flow journey, such as updating user data or applying heavier authentication to the process.
You could also consider providing a terms and conditions page that allows users to agree to a policy before using the system, direct your users to a series of training videos related to your Salesforce org and their business responsibilities, provide system status updates, or provide general business announcements and updates prior to accessing the system.
This sort of thing could be extremely beneficial across a wide number of industries. For example, in the healthcare space, you could ensure HIPAA compliance by ensuring users accept your updated privacy policies before accessing sensitive patient data. In the financial services space, you can require your users to read and acknowledge regulatory compliance documentation and complete periodic security or industry training. In the education space, you can capture updated contact information from your students at the beginning of a semester. The possibilities are endless as this can be applied to any industry, wherever you use Salesforce!
Example Login Flow
In this example, we’re going to be creating a screen flow that offers users the ability to accept basic terms and conditions.
Before you proceed, please keep in mind that you’ll need to ensure users have the correct permissions in order to execute the flow successfully and make changes to their user records.
The first thing we need to do is create a screen flow for what we want the user to see and do. For the purposes of this example, we’ll create a single screen element that allows them to tick the terms and conditions acceptance box.
The screenshot above shows the configured screen element of the flow made up of two components: a display text component with the written text that the user must review and the acceptance checkbox. I’ve also configured the footer to hide the Pause and Previous buttons and change the label of the finish button to display “Login” instead.
To ensure the user actually ticks the box before being allowed in, I’ve configured the Validate Input properties of the checkbox component to display an error if the checkbox component does not equal “True”.
Once the flow has been saved, this is what it looks like when debugging. We can see that the flow will display an error message if the user tries to click “Finish” before ticking the acceptance checkbox, but it will successfully complete when they do. Once happy, it’s time to activate the flow!
The next step is to apply a login flow. You can find this in the Setup menu under “Identity” (or if you’re lazy like me, search it in quick find).
Click “New” at the top of the list view to create a new login flow. Here, you can select the type of login flow (ours will be Flow) and give it a name. You’ll be able to select your flow and the profiles that this is going to apply to. Salesforce also offers the ability to run the flow in Lightning runtime, which they recommend you don’t run unless you have to. In our case, we will not be enforcing Lightning Runtime.
That’s it! Your final step is to log in as a user with the matching profile and ensure the flow functions as expected, but beyond that, you’re good to go!
Summary
Login flows can be used to capture information and provide guidance or instruction to your users at the very beginning of their Salesforce session.
If users are always asking the same questions about how the system works, you can provide instructional videos together in a screen flow and surface them as they log in. You can let them know about new changes to the system before they log in as well. The sky’s the limit!