Connecting to RestAPI from Excel or PowerBI and getting all fields in security incident to display

R34rvi3w
Mega Expert

Hello all,

 

 I have a requirement to bring in all ServiceNow Security Incident Records and any available fields that could be selected into Microsoft Power BI. This is really no different that Excel Power Query but I'm running into issues and getting a JSON error (possibly because I'm unsure of params). What endpoint should I use and what params to show all security incidents and related metrics (all records, no limit) but ensure they are structured so that they can be parsed/mapped?

 

 I tried https://(instance name).service-now.com/api/now/table/sn_si_incident and data was displayed, however I received the following:

 

This page contains the following errors:

error on line 6935 at column 2893: Opening and ending tag mismatch: result line 0 and response

Below is a rendering of the page up to the first error.

 

 I read something about this a few days ago, but doesn't seem to work for me here. I'm not really interested in exploring the params in detail because I can get PowerBI to clean all that up. I just need to return all SI records ever created, preferably at a start point like (01JAN2019) and ensure any fields that were selected/used/manadatory are there in the data set. How do I get this to work without errors?

Am I supposed to use this and if so, why does this not return data? 

 https://<instance-name>.service-now.com/api/now/table/sn_si_security_incident_view

Thank you!

Brian

1 ACCEPTED SOLUTION

Alex Cox
ServiceNow Employee
ServiceNow Employee
6 REPLIES 6

Erik Gunther2
Kilo Guru

Does the user account you are using have permissions to see all the columns? Maybe your issue is an ACL problem. This is just a guess as I haven't had that issue before, but I thought it might be helpful to ask.

Thanks Erik. I was able to get it to return 10 records alone using 

 

https://(instance name).service-now.com/api/now/table/sn_si_incident?sysparm_display_value=True&sysparm_exclude_reference_link=True&sysparm_limit=10

 

But if I choose 10000 for limit, Excel or PowerBI complains with something about data out of bounds.

The only other option I can think of is to use pagination by using the sysparm_offset parameter. Hope this helps.

R34rvi3w
Mega Expert

So I was able to return results now, including the desired fields (forgot about the API Explorer). 

 

However, I do not see any means to add a param for specific time filters (meaning I don't want to filter on last 10 or whatever SI records) where I can use a param that says "return only records since 01-JAN-2019" or something like that. I just saw something about offset - how would I do that?