First Time login of a user.

I need to detect whether it's the users first time they have logged in or not. The problem i have is that i want to create warnings for users that have logged in before. I have my default page as a microflow and currently i have a boolean which checks if it's their first login. If it isn't their first login it should generate some warnings for them. If it is there first time then i set the boolean to false. However if i press the home button i get the warnings. Is there a way to detect the actual first login. I am currently using the login form from the app store. I basically need some way to determine a login and a refresh, i think.
2 answers

System.User/Lastlogin checks when the user last logged in. You could check if this is empty/not empty to see if a user logged into your system before.


I am doing this in one of our applications.

The way I have implemented it is to use a microflow as default home page which checks a boolean attribute (default = false) of the User entity. If the boolean = false, it sets it to true and shows the form I want to show on the first login. If the boolean = true it shows the regular form.

This way you can also decide to set the boolean to true later on, for example, after doing whatever the User needs to do on the first login (in our case: supply some information). That way, the user will still see the first login screen even if, for example, their browser crashed before finishing.

EDIT: If the boolean doesn't work, you can try creating a dummy object, setting a relation with the User entity, and try retrieving that object on login to see if they have gone through the process before.