Rest Library for Google Apps Script

In previous posts I covered a couple of conversions of Excel VBA projects to Google Apps Script, with particular emphasis on maintaining compatibility between the solutions to allow for dual maintenance. Previous conversions have been a GAS Color Ramp and a GAS roadmapper.

This latest migration makes a GAS version of the Excel Rest library, This allows you to store a list of useful REST queries, and execute them to populate a worksheet both in Excel and Google Spreadsheets

Queries are very simply added – Here are a couple of examples. Included in the code are a whole bunch of GAS hacks which mimic VBA behavior to make these kind of conversions simple.

This is a simple geoCoding query using Yahoo geocoding rest API.
GAS version
function testYahooGeocode() {
    generalDataSetQuery (“geocoding”, “yahoo geocode”, “input address”);
}
 
VBA version
Public Sub testYahooGeocode()
    generalDataSetQuery “geocoding”, “yahoo geocode”, “input address”
End Sub
Here’s another – an interactive query on the iTunes Database
GAS version
function testItunesMovie() {
    generalQuery (“itunesmovie”, “itunes movie”,
        InputBox(“Enter your itunes movie search query (eg. artist name)”));
}
 
VBA version
Public Sub testItunesMovie()
    generalQuery “itunesmovie”, “itunes movie”, _
        InputBox(prompt:=”Enter your itunes movie search query (eg. artist name)”, _
             Title:=”itunes API query:results to the itunesmovie worksheet”)
End Sub

For more information and to download the VBA and GAS versions, see the ramblings site.

About brucemcp 225 Articles
I am a Google Developer Expert and decided to investigate Google Apps Script in my spare time. The more I investigated the more content I created so this site is extremely rich. Now, in 2019, a lot of things have disappeared or don’t work anymore due to Google having retired some stuff. I am however leaving things as is and where I came across some deprecated stuff, I have indicated it. I decided to write a book about it and to also create videos to teach developers who want to learn Google Apps Script. If you find the material contained in this site useful, you can support me by buying my books and or videos.

2 Comments

Comments are closed.