function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Static DevStatic Dev 

How to check login history object fields realtion with user object

Hello,
Is it possible to pulll login history object fields related to user object. I have a flow on user object need to check login history fields like type and platform.
There is a relation between user and login history object how to get those fields into a formula on user.
Please suggest thanks in advance.
 
Raj VakatiRaj Vakati
You can do with SOQL 
SELECT UserId, LoginTime from LoginHistory;

Refer this link 

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_loginhistory.htm


You will  get the object into the flow alsoUser-added image 

 
Static DevStatic Dev
Hey Raj thanks for response. As per your screen shot you used login history bot for me look up is User object.
And on user object i want to pull in login history fields i.e from user and login history relation fields as such.

 
Raj VakatiRaj Vakati
Hi Static,
Can you please let me know what you are trying to do exactly. 


SELECT UserId, LoginTime from LoginHistory where userId='005XXXXXXXXXXX'

refer this link to see the  login history

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_loginhistory.htm
 
Static DevStatic Dev
Hi Raj,
I have my flow on user object. In the flow want to set conditions based on user login type and application (fields from login history object) they login i want send those user to speicfic login screens .