01 logo

Login Flows in Salesforce

Have you ever wondered how Salesforce was showing a Maintenance message? Did you see Salesforce asking to provide the Phone number for Mobile verification?

By Shreya GaggadPublished 2 years ago 3 min read

Welcome to the world of Login Flows in Salesforce - one of our best-kept secrets! 😄 Common use cases include displaying release/notice messages, collecting and updating user data at login, configuring multi-factor authentication, and integrating third-party strong authentication methods.

Let's dive into the business use case that I recently tackled.

Business Use Case: 

In the organization I worked with, there are two monthly releases. Despite sending out release details via email, most users tend to skip reading them. So, the requirement was to display release notes to users on the first login after every release.

Solution:

A. Salesforce Object to Store Required Information:

Two Custom objects are created to provide control to the User to set up the Release Notes on every release.

1. Release Notes: This custom object holds details like Release start date, End Date, Release Number, Name of Release, and active checkbox.

2. Release Notes Screens: The Release Notes screens object has a master-detail relationship with Release Notes and holds details like Sequence number, text to display to communicate new enhancements and features, and Release name. 

3. A checkbox field is created on the User object to identify if Release notes for the current release have been displayed to the users.

B. Flow Details:

Screen Flow:

1. From the Manager tab in the toolbox, click New Resource and create a variable to store the user's ID. The login event passes a list of attributes to the flow. Use LoginFlow_UserId, which is used to verify the ID of the user logging in and query the associated user object. 

2. Check if the "Read" checkbox(Custom field that was created on User object) is Flase. If yes, proceed further.

3. Fetch the active release notes record and associated login screen records. Iterate through the Login screen records fetched in the sequence i.e. Iterate in ascending manner using the sequence field on the login screen records and display.

4. Once all the screens are displayed, mark the "Read" checkbox on User object as True.

Login Flow to Display Release Notes

Scheduled Record Trigger Flow to Update "Read": 

Use this flow to update the "Read" checkbox daily. The scheduled flow runs every day at 12 a.m. and checks the start date of the active Release Notes record. If the Start date of active release Notes record=Toady() then uncheck the "Read" checkbox on all users.

This will ensure that on every new release, the Read checkbox (that was checked on the previous release note display) is unchecked and Release note Screens will be displayed to the user.

Scheduled Record Trigger Flow to Update Read

C.Assign Login Flow To Profile:

Navigate to Set Up →Security Controls →Login Flows. Click on the New Button. Specify the name and select the license and profile. When users successfully complete the login flow, they are redirected to their Salesforce org or site. If the flow fails, users will be logged out immediately.

Tip: Don't associate a login flow with your administrator profile until you are sure that the login flow works properly. Otherwise, if it fails, you can't log in to your org. Also, take extra care to handle the null check Condition.

Challenge Faced and Resolution: 

Images to be displayed on the Login Flow Screens were added as images in the Rich Text Area Field on the Release Note Screens records. However, the images added here are saved in static resources in Salesforce. Login flows, do not provide access to users until the screens are displayed and the login flow is completed. Thus, the static resources are not displayed. 

Resolution: I hosted the images on Google Drive, published them to the web, and added the image address to the Release Notes Screen record. This allowed the images to be displayed within the screen flow.

Have Questions? Leave a comment. I will try to get back with an answer.

apps

About the Creator

Shreya Gaggad

IT Business Analyst | Salesforce | Digital Transformation

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2026 Creatd, Inc. All Rights Reserved.