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 get encoded query display value

lucky6
Tera Contributor

Hi Everyone,

I want to get date time fields display values so how can i get it in encoded query .

Example: opened on today

opened_atONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()

12 REPLIES 12

Pratiksha Kalam
Kilo Sage

Hello,

You can use method of getDisplayValue() by using glideDateTime.

https://community.servicenow.com/community?id=community_question&sys_id=97564cd4db10dcdcd58ea345ca96...

 

If answer is helpful please mark correct and helpful!
Thanks,
Pratiksha

Gaurav Shirsat
Mega Sage

Hi

In Addition to Pratiksha would like to share one more KA

https://community.servicenow.com/community?id=community_question&sys_id=13768325db1cdbc01dcaf3231f96...

Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat

balu3
Kilo Guru

Hi,

The question seems to be a bit vague. By "encoded query display value" what is exactly needed.

 

I mean lets say that

opened_atONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()

is not exactly in human readable format, and which dates gets applied when the query is run is not known or so.
Are you looking for something like that?

If that's the case, then see the above is not a static query. It is a dynamic query.
Meaning that if this query is executed today you get a result and if executed tomorrow you get a different result.

 

If you are looking for how to query a date/time using display value passed in, there are a handful of blog entries in the internet. You can go through them.

 

Thanks
Balu