How to check if a user is logging in for the first time in ServiceNow?

Sagar Manocha
Tera Contributor

Hi,

I need to fetch a report in which I need to find out the no. of users who have joined the ServiceNow instance in the past week or month. For that, I need to know when the user has logged in for the first time. 

If anyone has come up with same requirement before and knows the solution, please help. 

 

1 ACCEPTED SOLUTION

Tony60
Giga Guru

Hello,

would it be an Option for you to create a new field on the User table to track the first Login time?

When user logs in for the first time, the value in the field "Last Login Time" gets populated. And if the field changes from "empty" to "ANY VALUE" you could trigger a Business Rule to fill your new Custom field with the timestamp. 

And than you could report on that additional field who joined the Instance in the past week/month.

View solution in original post

7 REPLIES 7

Hi Sagar,

Since the first condition checks, if the user is created in last month, the user who was created 2 months ago will not come in this result. It will only give you users which are created AND logged in last month.

Also, unfortunately, there is no OOTB feature to know the first login. You can create a field in sys_user table and can add this information, but then this will only have information from now on.

Another option is to check events table which stores the login entry. However, this might get cleaned up periodically so not sure if you have all the entries in this table.

Mark the answer as correct if this helps.

Hi Sagar,

If the problem is solved, kindly mark my comment as a correct answer so that the question is removed from the unanswered list.

Tony60
Giga Guru

Hello,

would it be an Option for you to create a new field on the User table to track the first Login time?

When user logs in for the first time, the value in the field "Last Login Time" gets populated. And if the field changes from "empty" to "ANY VALUE" you could trigger a Business Rule to fill your new Custom field with the timestamp. 

And than you could report on that additional field who joined the Instance in the past week/month.