Excel Spreadsheets with Live Connection to ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2016 01:35 PM
While it can be quick and dirty to export data from ServiceNow into Excel, that data quickly becomes stale and disconnected from its source. If you prefer to have a refreshable connection between Excel and ServiceNow, you can make use of the web services available in ServiceNow to make the connection.
These instructions are written using Excel 2016 and the Geneva edition of ServiceNow.
- Locate the name of the table in ServiceNow that you want to pull data from. If you're a developer, you can look these up directly. Regular users can do this in a couple of different ways. The easiest is to create a new report from the "View / Run" module of the Reports application. There is a field there to select a source table. The name of the table in square brackets is the name of the table you'll use in subsequent steps.
- Open a blank workbook in Excel.
- From the ribbon, find the Data tab and choose New Query, From Other Sources, From Web.
- For the URL, put in https://<instance>/api/now/table/<tablename>?sysparm_limit=10
Replace <instance> with the name of your own instance (e.g. dev01.service-now.com) and <tablename> with the table you want to query (e.g. incident). The first query parameter will just limit your query to 10 rows while you are testing to avoid pounding your server while you learn what you're getting back. You can change to any number, or remove that parameter altogether. - The first time you try to access a particular domain, you will be asked how you want to authenticate to that resource. You'll probably want to choose Basic authentication and put in a username and password. These will be stored within the Excel document, which means they are only as secure as the document itself, so use caution.
- Assuming you can successfully authenticate, you will see the Query Editor. The result in a single object which is a List. Click on the link List to expand it.
- In this example, I used sysparm_limit=10 so that I got 10 rows from my incident table. If I were to click on an individual record in this list, I would see all the attributes of that record. But what I'm really interested in is to see all those attributes as columns in a table view. To get that, I need to convert the query response into a table. Use the To Table button on the ribbon to do this. Just accept the defaults on the dialog box that pops up and click OK.
- Once you've converted to a table, you have a magical button to expand records into columns, to the right of each expandable column. When you click that button, you can select which columns should pop out of the expansion and if they should have a prefix from the old column name.
- Once you have the records you are looking for, you click Close & Load in the Query Editor and you'll be returned to your spreadsheet with all the data in a nice table that you can manipulate in the usual Excel fashion.
You can repeat the query for multiple tables and relate data together in Excel in ways that are hard to do with the normal ServiceNow reporting tools. (I love PivotTables.)
You can explore more ways to manipulate the URL string for your original query by using the Rest API Explorer in ServiceNow if you have enough rights on your instance. There are additional query parameters for the query and for the display values that are handy to play with.
Of particular value is sysparm_query where you can filter the records before you pull them down into Excel. This is especially helpful for very large tables. You can learn the syntax of the sysparm_query parameter by building filters in the regular ServiceNow user interface and seeing how those translate into URLs. For example, sysparm_query=active%3Dtrue will limit to just the active records on the table. The full query URL might look like this:
https://<instance>/api/now/table/<tablename>?sysparm_limit=10&sysparm_query=active%3Dtrue
Anytime you're working with your spreadsheet, you can go to the Data tab on the ribbon and choose Refresh All to get the most current information out of your ServiceNow instance.
I haven't been using this for very long, so I'm open to feedback about this procedure and how it can be improved or better documented.
- 55,568 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 01:50 PM
I'm not sure how Excel handles the credentials it stores. I don't think they are stored with the workbook but are stored with the user account for that installation of Excel. If the password were stored in the workbook, it could be extracted which probably isn't desirable.
We use SnowMirror to copy some of our data to a data warehouse when we want to create reports with Tableau that aren't possible inside ServiceNow itself. This doesn't allow end users of the report to refresh the data at will, but we can set the refresh interval on the SnowMirror server and still keep the credentials for our ServiceNow instance confidential.
We make very minimal use of the PPS. We are about to implement Oracle Cloud as our project management tool. We'll see how that goes...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2017 08:26 AM
Hi Bradley,
I'm really keen to get some automated Excel reporting up and running.
We use PingID to log into our service now instance.
While I have access to reporting and exporting of records in the web interface, I cannot work out how to get Excel to authenticate, as I do not have a basic username/password to use.
Is this something I'm likely to have to request from my administrator?
Regards,
Jonny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2017 12:21 PM
I'm not familiar with PingID. If you single-sign-on provider makes it so that you can't use basic authentication, then you could ask your administrator to set up a local (on the server) account that you could use instead.
Our own instance is configured so that you can either use LDAP to log in (which is what the basic authentication ends up using) or you can use our SSO integration with CAS. So we get the best of both options.
Some administrators don't allow web service calls on their instance. That is another reason your connection from Excel might not go through unless they grant the necessary permission to your user account.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2017 02:03 AM
Thanks for your prompt response. I'll speak to our admin to see if we have a specific login for this type of access.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2018 05:07 AM
Hi all,
I tried to set up the connection to my Excel 2016 and it seems I can pass the authentication with Excel however once the query should happen I get this error:
If I use the query in my browser I get an answer, regardless of the query.
I assume it does something to do with the format of the answer or the query type (used Web as proposed) but I'm not that experienced on this field so would need your help to get this sorted.
Many thanks,
Adam