The CreatorCon Call for Content is officially open! Get started here.

Using sysparm_query with Incident table

thedavegray
Giga Expert

Hi all, 

 

Can I please get some starter advice on using the query parameter sysparm_query on the Incident table. 

 

Is it possible to get a date range based upon the sys_created_on field? So for example I would like to get just elements that match sys_created_on>=2022-01-21 AND <2022-01-22, I tried this but it does not work, it returns 

elements for 23rd, 24th etc,

 

sys_created_on%3E%3D2022-01-21&sys_created_on%3C2022-01-22

 

On the understanding that %3E%3D is >= and %3C is < (less than). 

 

Is it not possible to use multiple parameters with sys_created_on?

 

Screenshot of query running in Postman with values greater that 

 

thedavegray_0-1674573350666.png

 

Thanks 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Basheer
Mega Sage

It should be like this

sys_created_on>javascript&colon;gs.dateGenerate('2022-01-22','00:00:00')^sys_created_on<javascript&colon;gs.dateGenerate('2022-01-23','23:59:59')

 

Full link should be like this

 

https://instanceName.service-now.com/incident_list.do?sysparm_query=sys_created_on%3Ejavascript%3Ags...

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

View solution in original post

10 REPLIES 10

Hi @thedavegray ,

I would recommend to use sysparm limit and offset for the requirement instead of sysparm first row.

Do remember to set the quota limits before setting the sysparm limit. By default it is 60 seconds.

You can either increase the quota limit to increase the data in a single call or decrease the sysparm_limit so that whatever data is there goes within 60 seconds.

 

Refer below link for documentation and learning.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0727636

https://developer.servicenow.com/dev.do#!/learn/courses/sandiego/app_store_learnv2_rest_sandiego_res...

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.