Flow Use Case – Use Before Save flow to update the total login count on the user record

Trying to report on user login history using standard Salesforce reporting can be tricky. If you would like to see each users’s last login and his total login count for the last 6 months, sorted by login count, you have to use some external Excel manipulation. I was looking to get a simple report I could use to monitor login usage.

Simple Login Report



I was able to provide a nice solution using the new before save flow record trigger. The first step is to create a number field on the user object to hold the login count. Then create this simple before save flow. This flow updates the custom field on the User object. By incrementing a counter every time a login history is generated, each user shows a login count. Then, at any time, you can generate the report by simply reporting on your users.

User Login History Flow
Get Login History Records
Confirm records are returned (Null Check)
Use the record count operator to assign the record count to the user field
If no records are returned, assign zero login count

This use case can be easily adapted to rollup any related records on other objects. I can think of several examples: count of opportunity contact roles on opportunity, count open cases on a contact, count of won opportunities on an account.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments