Understanding Login Flows Default Variables

So, you’ve been tasked to create a Login Flow for your company, but for some reason it just isn’t working for you.  You’ve been double-checking the variable’s input/output value, the field level security of the users, and just about everything else you can think of.  And you’re about ready to throw the towel in for the day, remember that Salesforce isn’t letting you use your coveted naming convention, because you must use theirs.  In this post we are going to go through the variables that Salesforce gives us and what they are used for.

But first, what are some of the use cases for Login Flows?

  • Authenticated User Access
    1. Get fancy with some Geo-fencing service
    2. Quiz the User a ‘secret question’
    3. Restrict IP Usage on a User Basis
  • Alert Messaging
    1. Push company wide alerts out, be it a Pizza Party on the 2nd Floor or the upcoming Quarterly Meeting
  • Data Cleaning
    1. Make sure your users validate their contact information every 6 months
  • Training
    1. Put together a series of training screens for new users
    2. Put your release notes of new features inside to make sure users are aware
  • April Fools
    1. Prank your Sales team with a fake error.  Don’t blame me, but you can thank me.  I would recommend having management’s buy-in before doing this.

Now that we have gone over some ideas around what we can do, lets dive in to the attributes!

LoginFlow_LoginType

The Login Type is where you can tell what TYPE of User is entering your Flow/Org.  This allows you to find out if its a user type of Application or something like Chatter Community.  This typically will be Application.

Choose Your User Type

LoginFlow_IpAddress

This is the Current IP address of the user.  This is the IP Address of the User that is logging in.  Now, this is pretty powerful… think about it.  You can now restrict specific IP Addresses down to the Profile, User, or any other field related to the User Object if you wanted to!

campfire

LoginFlow_UserAgent

This is the user agent string provided by the user’s browser.  In my case when I logged in to a Screen showing me this variable, I got quite a long string back.  Sure enough though, Google Chrome was inside of it.  If you wanted to exclude users from logging into your Org with Internet Explorer, you could do it using this (if you can master the data that the user agent is providing).

BrowserLogos

LoginFlow_Platform

What is the user logging in from?  Mac OSX?  Something else?  This is where you’ll find out.

LoginFlow_Application

What are they logging in from?  Browser? iPhone? Carrier Pigeon? Find out here!  Maybe you want to send them to a different finish location (home screen) based on what device they are using.

Devices

LoginFlow_Community

This will display the current Community, if this login flow applies to a Community

LoginFlow_SessionLevel

This displays the security level of the current session.  This is either Standard or High Assurance.

LoginFlow_UserId

This displays the user’s 18-character ID.  Here is where you can do a Lookup on the Login User and query the system to find any related fields that you want to use in your Flow.

User Id

RECAP: Login Flow Variables can be used for some powerful stuff. Make sure you name them exactly as they are listed here (and in Salesforce’s documentation), otherwise it won’t work!  Salesforce has given us quite a lot of power to determine who is entering the Org and what we want to do with them.  Study up and think of how this might be able to help out your company or clients!

One thought on “Understanding Login Flows Default Variables

Leave a comment