Last Updated on February 10, 2022 by Rakesh Gupta
Many times we want to display Notices, Messages, or Information to our users after they successfully logged In to Salesforce. For example, similar to Salesforce downtime or maintenance notifications. Displaying information after login will help the organization to keep its users informed about upcoming events or changes.
Objectives:
After reading this blog, you’ll be able to:
- Understand what is a Login Flow
- Setup a simple Flow
- Understand how to set up a Login Flow
Business Use Case
Edward Backhouse is a System Administrator at GurukulOnCloud. Edward received a requirement to company upcoming webinar registration link (with banner) to users when they successfully logged into Salesforce.
What is Login Flow?
Login Flows give you the flexibility to build a custom process that can be used to display a message, take users’ input, and process the data, build a post-authentication process that meets your business requirements. For example, you want two-factor authentication only when a user is trying to log-in from a particular City, Subdivision, Zip code, County, or Browser. Let us start with a business use case.
Automation Champion Approach (I-do):
Usually, with Salesforce, multiple approaches are available to solve a business requirement. Choose the ones that are simple, straightforward, and consume fewer resources.
Similarly in this scenario, we will use a combination of Flow and Login Flow. Before trying to understand the technical aspect of the solution, let us spend some time to understand the general flow of our solution at a very high level. Please spend a few minutes to go through the following flow diagram and understand it.
Let’s begin building this automation process.
Guided Practice (We-do):
There are 3 steps to solve Edwards’s business requirement using Salesforce Flow. We must:
- Add a Screen Element
- Add a display Text to Screen Element
- Set up a Login Flow
Step 1: Add a Screen Element
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the New Flows.
- Select the Screen Flow option and click on Create.
- Drag-and-drop Screen element onto the Flow designer.
- Enter Label the API Name will auto-populate.
- Click Done.
Step 2: Add a Display Text to Screen Element
- On the Screen element, navigate to the Display section and double-click on the Display Text field, to add it on to the Screen element
- Enter API Name.
- You can now use a Rich-text editor to add content like Text, Image, URL, etc.
- Click Done.
Once you’re done, Save the flow and name it Display Flow on Login. Do not forget to activate the Flow by clicking on the Activate button.
Step 3: Set up a Login Flow
- Click Setup.
- In the Quick Find box, type Login Flows.
- Select Login Flows then click on the New.
- Select the Type from the drop-down Flow.
- Enter Display Message on Login as a Name.
- The next step is to select Flow, User license, and Profile. Follow the steps as shown in the following screenshot:
- Click Done.
It’s time to test the Login Flow
Now, if a User with profile Salesforce successfully logged In, they will see the flow which displays the message.
Great! You are done! Feel free to modify it based on your business requirement.
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.
Hello,
If I want to use this existing flow to display this message each Thursday every two weeks what would the best way to adjust this?
Here you go:
Another solution:
For some reason the image is not showing up on the login screen even though it appears in the screen in Flow Builder.
For some reason the attached image is not coming through when I try logging in even though it shows in the screen within the actual flow.
I want to display the message for Morning and Evening seperately, like If a user login in the morning then the message display Good Morning and If the User login after 5:00 P.M after business hours then it display Good Evening. I tried but couldn’t find a way to track the time If it’s evening or morning when user login. Is there any way you know about?
You have multiple options to solve it.
1. Create a formula to get hours from the current date/time and then decide.
2. Use this component (plug-in) from Unofficalsf.
Only problem is Outlook login.
It fails if the login flow has “Render Flow in Lightning Runtime ” activated.
Anyone found a solution for this?
I tried as per the article. its working However, I would like to display the maintenance message on the specific time period.
since, we have used screen flow in above article it can not be called via process builder.
I would like to set up a maintenance message for schedule time period via flow.
Kindly help on this.
Regards,
Praveen
You can save maintenance time in the custom metadata Type and before display the screen write the logic. Check out this article for some idea
Hi guys, i not able replicate the same at present, like I don’t see any “Drag and drop a Record Lookup” component in flows can any one help me on that
Use Get Record element
Great article, thanks
Is there a way to create a login flow that posts a message for ALL profiles? I don’t want to have to create a separate login flow for each of our profiles, but in searching I don’t seem to find a solution.
AFAIK, the answer is No.
Is there a way for me to detect the browser (IE11, chrome, Firefox) and display it?
If yes, how do I do that?
Thanks
Use LoginHistory object
Hi Rakesh,
Thank you for that tip, it worked. I have another follow-up question to the browser.
I am trying to configure a flow to check if Internet Explorer is detected, it will pop up a message but if it were other browsers, nothing will pop up (just a normal login)
I am unable to figure out the mechanics on how to implement an If-Else situation here. Can you please help me out?
Use LoginHistory object to grab the browser information
Can this work for communities?
Yes!
Could you please write a blog explaining how would it work in community and also it should only be shown only specific no. of times to logged user. We want to use this feature for onboaring the customers (say should this for first 5 times) to the customers so that he can get familiar with community and also use this feature for some urgent announcement say only one time to each user
Here is my suggestion for you – Create a field on User object to store the count. And then in the Flow (update the count) and display/Skip the Login Flow based on your requirement (5 or more)
We are trying to do this but after the login flow user is going to a page which can not be accessed. Will Visualforce work at the end of the flow to push users to custom URL page ?
In your Flow create a Variable LoginFlow_FinishLocation (type string) – LoginFlow_FinishLocation (type string)—This attribute determines where to send the user when the flow completes.
In the default value of the variable – defined URL
Thanks. I tried that. now I am trying to login and I get this error “An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information.”
Also I received an email from sandbox saying
Flow Details
Flow Name: SF_lOGIN_fLOW
Type: Flow
Version: 1
Status: Active
Flow Interview Details
Interview Label: SF lOGIN fLOW 7/6/2017 1:10 PM
Current User: Arun Govindan (00520000003e2vV)
Start time: 7/6/2017 1:10 PM
Duration: 0 seconds
How the Interview Started
Antony Test (00520000003e2vV) started the flow interview.
RECORD QUERY: Get_Login_Text
Find one Notice_Board__c record where:
Display_Text_2__c Equals
Result
Failed to find record.
Without looking at Debug Log it is very hard to identify the root cause. But in your case, it seems like Flow is Failed to find a record.
Hi Rakesh,
I lost you @ step 6, Once we drag and drop “Screen” to flow we have 3 tabs- 1.General info, 2.Add a field, 3. Field Settings.
Could you please explain what needs to be done here.?
1. Navigate to Add a field tab
2. Then add a Display Text”
3. Then configure it. Make sure to add {!GetInforText} varibale
One more question! The field I added shows on each record on my custom object, but the alert will only show the information from the most recent field that I have updated. Is that by design? I would think the alert would show all of the information under each field.
It will depend upon your design, what you want to display. Remember :- Flow runs in user mode not in system mode
It would be great for the log-in box to show any information that is listed in the field DisplayText. Right now that field is in three different locations but in one object. How would I accomplish that? I apologize, my experience with flow is VERY minimal.
Use Record Lookup element to get all the display text and save it in the different variable as shown in the following screenshot
https://rakeshistom.files.wordpress.com/2015/07/get-all-dsiplay-text.png
Now use Display Text field on Screen element to show the data from different variable as shown in the following screenshot
https://rakeshistom.files.wordpress.com/2015/07/display-message.png
So does this record lookup replace the other lookup for the GetDisplayText? It looks like the screenshot is saying I need to create three different display text fields on my object. So how would I know which field already has something in it? Is there a way for me to post a screenshot so I can show you? This is a custom object if it makes a difference.
Can you please upload your document in Dropbox public folder and then share the link here
https://www.dropbox.com/s/46tjmsy8prryqm9/Login%20Flow.docx?dl=0
You have to use Three different Lookup Elements to get the data from these records.
Great, that worked. Is there something else that needs to be added or checked off if there is nothing in the “Display Text” field? Right now if there is nothing the box pops up still upon log-in but it is just empty.
This is great! I set this up in my devorg and when I run the flow in the flow it works, but if I log in as a user nothing pops up. I’ve tried different profiles thinking it was a permission issue, but nothing changes. Any thoughts? Is it because I’m logging in via the Users and not logging out and typing in their password, or should it work both ways?
Hello Stacey,
It will only work for those users who have same profile that you have selected at the time of Login Flow creation. Yes, you have to be logged out and then login again, After successful login attempt a Login Flow will appear.
Rakesh
The notice page displays in the user’s Recent Items as a view only object. I can’t think of a way to suppress this with security, as they need view access to see the maintenance page.
Any ideas on suppressing the Maintenance Object from the user’s recent items?
Please ask your question again.
Thanks for the good information. Is there a way to have a url (link) display as the notice and after the user clicks on it and is taken to the url’s page, the notice no longer displays for that user when he or she logs in……but for users who have NOT clicked through, the notice will still display until they do so. Possible?? Thanks in advance.
Possible with some customisation.
Hi Rakesh,
Thanks for the post..we tried and it is working fine. Actually I’m trying to add VFP(Like agreement page) with in the Flow section instead of showing display information or Alerts. SF given “To add a flow to a Visualforce page, embed it using the component” But here I’m trying to add VFP to Flow.If you have any idea please guide me …
Thank You
Satya
Hi Satya,
Currently it’s not possible to add VFP to Flow. To solve your requirement (i.e. create a Agreement page) you can “read only” text and Check box.
Rakesh
Yeah I’ll try that. Thanks for the quick response.
We are hoping to use this for our release notes. Do you have any advice for creating notice boards over 255 characters?
Try to use Text Area(Long) field type instead of Text Area field and please let me know how it goes.
Thanks for responding. Yes, I tried both the other text types and there is an error saying they are not compatible with workflow. Was wondering if you knew of a workaround. I’ll keep researching!
Let me try it. Meanwhile can you please try with two Text Area fields something like field1 + field2
Hi Rakesh, Thanks for your post. Is there any way to restrict the flow to run only once in a day when the user logs in? means display this message only once in the morning and not for nay subsequent logins in the same day
Not right now.
Very nice Rakesh, do you have idea if we need to implement to many profiles rather than create Login Flows for each profile?
Second, anyway to check if user already see it, can we skip the window?
Thanks Johan. No there is no way to create login flow in bulk for all profiles or selected profiles.
I think you left out a good part – that is to create a Notice Board record.
Yes, will update it shortly. Thanks
Yeah, because I enabled it for the System Admin profile, logged out and now can’t log back in because it always trips on the Flow error. But this is a cool idea. Thanks for posting!
Don’t play with your system admin account. Best practice is to test it by using custom profile.
Done!