Logins flows is one of the cool features in Salesforce of which lot of people are not aware about. What it does is, when user logs in it launches the visual workflow before landing them to salesforce landing page.
If you are now aware about what are Visual workflow or flows then checkout salesforce development guide before reading this topic. Link
Where it can be used
- Conducting internal survey
- Taking feedback
- Identity Confirmation/Authentication via email etc.
- Users have to go through the flow after login
- You can control which profile you want to activate the flow.
- Quick development (10-15min max).
What we are doing here and how ?
Most often we have seen people don’t respond to surveys or don’t provide feedbacks when it is required. Which gives false data and so on…
Lets assume a Scenario there is annual conference/ function etc is happing in your organisation. And the management wants to know who all attending, who will eat what and no of guest they will bring. In general this takes time, HR or the management person has to send reminders after reminders.
Now since your organization is using salesforce you can use login flows.
Step 1 :- Create a object
Create a object with respective fields (this object can be used in future too).
Step 2 :- Create the Flow
Create a flow, create the first step as record lookup, which checks that if this user has already submitted the survey. Login flow will allow you to get current user fields , you get UserId, UserAgent, Platform, LoginType. To use this fields create a variable with name $LoginFlow_VARIABLE_NAME. Assume you have create $LoginFlow_UserId which gives you the userId.
Next, search the survey object. :-
Assign Survey record Id to a new variable.
Next :- Create a decision if your survey object id is null means your has to be redirected to survey screen. If not null user already submitted the survey and redirect to salesforce screen.
Step 3 :- Add the flow to Login Flow
Once your flow is created, go to setup -> Login Flow -> New, add the flow to login flow and select the profiles which you want this to be active. This is one of the best things here you can control for which profiles you want to activate the flow.
My Flow Screens
This were the flow screens I have created for this example :-