ServiceNOw and Power BI integration((Scripted REST API)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 06:44 AM
Hi All,
I am trying to create a scripted REST API call to integrate ServiceNow with Power BI.
so far, I have created a database view in ServiceNow and the below REST API call to get the data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2024 02:00 AM - edited 07-21-2024 02:01 AM
Hello,
The sysparm_limit and sysparm_offset are usually used to achieve this in ServiceNow (while ensuring performance).
1. sysparm_limit - returns number of records in one call.
2. sysparm_offset - the records to exclude from the query.
You can try this in the URL - something like this:
On first attempt try URL1: /api/now/table/incident?sysparm_limit=10000&sysparm_offset=0
Next with URL2: /api/now/table/incident?sysparm_limit=10000&sysparm_offset=10000
Later: /api/now/table/incident?sysparm_limit=10000&sysparm_offset=20000
(Always sysparm_limit is 10,000 while offset increments by 10,000+)
Hope this helps!
Regards, Akash
_____________________________________________________________________________
Please mark it as helpful👍 or Accept Solution✔️ based on the response to your query.
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 06:14 AM
Thank you Akash. So I have around 200000 records as of now.so I will be making around 200 API calls.
eg-URL200: /api/now/table/incident?sysparm_limit=10000&sysparm_offset=200000
my doubt is ,when I am feeding the data to a third party tool (Power BI),there should be 200 API calls for the data till date and then more calls for newer data. How to achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 06:37 AM
Hi Akash,
Thank you for responding.
so currently I have around 200000 records.so I have to create around 200 API calls and the last call should be something like below
URL200: /api/now/table/incident?sysparm_limit=10000&sysparm_offset=200000
Then I have to get the newer data in in power BI as well. I am trying to understand what will be the best way to achieve this.
Also,I notice the data in the second API call (URL2: /api/now/table/incident?sysparm_limit=10000&sysparm_offset=10000) is the same as the first
(URL1: /api/now/table/incident?sysparm_limit=10000&sysparm_offset=0)