- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2015 08:14 AM
Has anyone set up an API to have Google Sheets GET information from a table. For example, how hard is it to run a job that will update a Google Sheets file with the current data in the incident table?
Solved! Go to Solution.
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2015 08:01 AM
It would be a GET. You'll want to go to script.google.com and create a script that looks something like the below to fetch the data. This example is pulling everything in the incident table. Parsing the json and loading it into a sheet I think is beyond the scope of this forum. There's a lot of info out there about how to do this once you've got the json.
function myFunction() {
url = "https://dev15112.service-now.com/api/now/table/incident"
var options = {
"headers":
{
"Authorization": "Basic " + Utilities.base64Encode("user:password"),
"contentType": "application/json"
}
};
var response = UrlFetchApp.fetch(url,options);
// Here you can see what the response was
Logger.log(response);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2015 08:01 AM
It would be a GET. You'll want to go to script.google.com and create a script that looks something like the below to fetch the data. This example is pulling everything in the incident table. Parsing the json and loading it into a sheet I think is beyond the scope of this forum. There's a lot of info out there about how to do this once you've got the json.
function myFunction() {
url = "https://dev15112.service-now.com/api/now/table/incident"
var options = {
"headers":
{
"Authorization": "Basic " + Utilities.base64Encode("user:password"),
"contentType": "application/json"
}
};
var response = UrlFetchApp.fetch(url,options);
// Here you can see what the response was
Logger.log(response);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2015 08:04 AM
Just what I needed. Thanks Dan!