- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2020 07:13 AM
Hi All,
Need help. I am trying to build a dynamic query where sys_created_on is passed to the table using the sysparam=sys_created_on attribute. Now my question here is how to build this query.
Source= Json.Document(Web.Contents("https://servicecentral.capgemini.com/api/now/table/prolem",
[Query=sysparm_query=sys_created_on%3E%3Djavascript%3Ags.dateGenerate(dtquery)]))
where dtquery is the date variable holding the date value.
Just to add I am using this query to get data into power bi using power query.
Please guide
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2020 07:28 AM
you should send it like this
Send the date as dynamic value which is highlighted in bold
sysparm_query=sys_created_onON2020-07-17@javascript:gs.dateGenerate('2020-07-17','start')@javascript:gs.dateGenerate('2020-07-17','end')
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2020 07:28 AM
you should send it like this
Send the date as dynamic value which is highlighted in bold
sysparm_query=sys_created_onON2020-07-17@javascript:gs.dateGenerate('2020-07-17','start')@javascript:gs.dateGenerate('2020-07-17','end')
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2021 08:09 AM
Hi Ankur
Can we pass any variables date in place of those bold dates?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2021 05:28 AM
Hi Ankur,
How can we pass sysparm_query greater than some date ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2021 06:02 AM
you can manipulate the date
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader