Check if user is logged in
Application Type


Is there a way to check if a User is already logged in when he or she enters my application? 

I am trying to figure it out like this - User opens up the application and if he or she is logged in it will send them to screen B. If not, be sent to screen A (login screen).

Best regards, Steven.


That is something already provided by the login flow in OutsystemsUI:

You just need to guarantee that you haven't Anonymous role checked in the Roles web screen:

Hope this can help.

Best regards,


Hi Steven,

I see some other answers that strictly speaking answer your question. I
In ways of architecture I think you should have a look at @Ricardo Pereira's answer, since this is the nicest way to do it. You have a screen that needs to be used by logged in users. If a user isn't logged in, you can use the security exception to have him redirected to a login screen. (See:


You can check UserId using the GetUserID() action and redirect your page. 



This was my initial though too.

Any pointers how I can write this if-statement?

Thank you!

You can write a condition like this: 

GetUserId() <> NullIdentifier()

If true continue with the flow, if false redirect user to the Login page.

Hello steven,

as suggested by muhammed its right used getuserid<>nullidentifier

if still that is not working for you so may be there is next level suggestion not sure that's you requirement or not but above things is not working then go through this on as well

Thanks and Regards,

Akshay Deshpande

I got it to work! Thank you :) 

Hello steven,

its glad to help you if you got solution then marked as solution so if anyone needed find solution easily.

Keep coding :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.