Exporting from a list based on a date range

Vikas Bhatia1
Kilo Contributor

Hello,

I am looking to extract cmdb data from another application using the REST api call. I want to export data based on a date range, but by not hard coding the dates. I tried by using the sysparm_query=sys_created_onONYESTERDAY+10, but it still exports all the records. Does the filter qualifier does not accept days addition or subtraction with the date values.

I am trying to resolve the issue of working withing the CSV export limit. Possible uses cases -

1.  filter by date between 1st till 15th of the month

2. filter by date between 16th till end of the month

3. filter by {current date -5}

e.g.  - to provide a list from last 5 days only. 

https://<instance>.service-now.com/cmdb_ci_computer_list.do?CSV&sysparm_default_export_fields=all&sysparm_query=sys_created_onONYESTERDAY+4&sysparm_orderby=sys_created_on

Thank you,

Vikas Bhatia

 

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

Try the 'Relative' operator.

find_real_file.png

The encoded query for this screenshot looks like this.  You can right-click the breadcrumbs or access the URL to get the query associated with any list in the system.

https://yourinstance.service-now.com/incident_list.do?sysparm_query=sys_updated_onRELATIVEGE%40dayofweek%40ago%405

View solution in original post

5 REPLIES 5

Vikas Bhatia1
Kilo Contributor

Great.. Thanks Mark, I will try that out.

 

-Vikas