How to check whether user is logged in first time to instance?

KrishnaMohan
Giga Sage

Hi all,

for the users who logged in first time to the instance I need to show some message on portal. how we can achieve this. can anyone have idea?

Thanks

3 REPLIES 3

Vaibhav
Mega Guru

Hello @KrishnaMohan 

 

The sysevent table will only have the last 7 days of data. To get the information you are looking for, you must create a customized script on a sysevent table to capture the required information to a custom table of your choice and use that table for reporting. 

If you use a real-time Business Rule, it can create a lot of load on the instance as this is one of the busiest/frequently accessed system tables of the instance platform. 

You can plan for a scheduled custom script that pulls the required information once a day during your NON-business hours. This can pull the required information (columns/data required) daily into the custom table of your choice and be used for reporting. 

https://instancename.service-now.com/sysevent_list.do?sysparm_query=name%3Dlogin%5EORname%3Dlogout

  • Name ==> login/logout
  • Instance==> Session ID of the user
  • Parm 1==> Username
  • User id ==> sys_id of the user
  • Username
  • Claimed By ==> Node on which the user was logged.
  • Created ==> timestamp of Login/logout activity

 

Report on user_activity (1).jpg

 

 

Please mark my answer helpful and solution accepted if it serves the purpose..

 

Regards,

Vaibhav

Martin iTSM
Tera Guru

Hi KrishnaMohan,

there`S a "last_login" field on the [sys_user] table which is empty as far as i know until the user logged in for the first time. So if you check via a Business Rule or in a widget if that changes from empty to not empty you should have your trigger?
Only thing i`m not sure about right now is how it is if you have SSO set up - might be that there`s something in there then - but i don`t think so.

Hope it helps.

Cheers!

Martin

Ben_Barker
Giga Guru

Hi!

 

Not sure if it’s on target with what you’re looking for but Adoption Services is an app that allow to configure Onboarding Modals (pop ups basically). They are meant to show only on first login after publishing.

 

https://docs.servicenow.com/bundle/vancouver-platform-user-interface/page/administer/navigation-and-...

 

Hope it helps!!!