Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Report generation with filter

Hemamani Prabha
Tera Contributor

Hello all, 

 

I need to generate a report with the following condition.

User record moved from Active False to Active True this month (Oct '23)

How do I set the filter condition for the above statement. This is for user table.

please advise.

 

Thanks in advance,

Hema

2 REPLIES 2

Wybren1
Tera Guru

The issue is that there's no specific date field set when a user is set "inactive".

The only thing you could do with the current data is filter on "active=false" and updated last month/this month, but then the record should have not been updated by anybody in the past months after the check is set.

Better solution is to add a date field with the name like "offboarded" or "inactive since" and run a business rule that will fill it with the current date when the active is set to false.

Hope that helps!

Tai Vu
Kilo Patron
Kilo Patron

Hi @Hemamani Prabha 

If the User [sys_user] table in your instance is enabled Audit. You can look into the Sys Audits [sys_audit] table.

Sample below.

TaiVu_0-1698331248764.png

 

In the other hand, you can define a Metric Definition for the Active field in the User [sys_user] table.

When the Active field changes, it will generate data into the Metric Instance [metric_instance] table.

TaiVu_1-1698331495727.png

 

Let me know if it work for you.

 

Cheers,

Tai Vu