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.

How to fetch today's Date in Configure Function Field in a report

Mubashira
Tera Contributor

I am trying to apply a datediff() function to create a date difference field. How can I fetch today's Date to subtract it from sys_created_on field in Configure Function Field option in a report.

Mubashira_0-1690756909658.png

 

9 REPLIES 9

Bert_c1
Kilo Patron

Hi,

see:

https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_GlideSystemAPI#r_GS-dat...

And you show that your use of 'nowDateTime()' is not supported there. Seems you need another way to achieve your goal.

Mubashira
Tera Contributor

Thanks, I have tried but no luck.

Samaksh Wani
Giga Sage

Hello @Mubashira 

 

var gdt = new GlideDateTime();

glidefunction.dateDiff(gdt,sys_created_on);

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Thank you Samaksh. Actually this works in script but I am declaring parameters in a 'Configure Function Field" in report.