Function Field in Report: Calculate Days Since Last Password Change Using Current Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi all,
I am trying to create a report in ServiceNow that shows the number of days since the last Password change date for each record. I want to calculate:
Days Since Last Password Change= Current Date – u_last_password_changed
Requirements:
I do not want to add a new field to the table.
I tried using Configure → Function Field in the report.
I attempted the following:
glidefunction:dateDiffDays(u_last_password_changed, today)
glidefunction:dateDiffDays(u_last_password_changed, gs.nowDateTime())
…but I keep getting errors:
"Function has returned an invalid result""nowDateTime is not a supported function"
I also tried using the today keyword, but it is not accepted in Function Field.
Goal:
Calculate days dynamically based on current date
- Do this without creating a new field on the table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @pathumharsh
Though you do not want to create any new field, still sharing this KB article:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0854574
Check this links if it helps you:
https://www.servicenow.com/community/guided-learning-itsm/set-new-password-policy/m-p/3314871
https://www.servicenow.com/community/developer-forum/password-reset-after-xx-days/m-p/1434954/page/2
