Getting Started
Step 1: Install the Add-on#
If you haven't already, install the Data Connector Add-on for Google Sheets from the Google Workspace Marketplace
Step 2: Run your first command#
Open the Data Connector side menu and click the "New Command" button
- Name your command
chuck - Select
APIfor theType - Select
GETfor theMethod - Enter
http://api.icndb.com/jokes/random/+++1+++in theURLfield - Select
JMESPathas theFilter type - Enter
value[*].[joke]in theExpressionfield - Click
SAVE
Now you're ready to run your command:
- Enter
=run("chuck","3",$A$1)in cellB1 - You'll see a list of 3 jokes. Enter a different number to get more or less jokes
- To refresh the formula, change the value in cell
A1
A quick note on parameters
In the above command, we added a parameter: +++1+++. We could have easily hardcoded the parameter instead: http://api.icndb.com/jokes/random/3. Parameters, however, let you reuse your queries and are great if you are retrieving, say, stock data for multiple tickers. Without them, you'd have to create a new request for each ticker. Boo!
You can also add multiple parameters to a request, and they can be in the headers, body, and other parts of the request. To parameterize other parts of the request, just keep incrementing - e.g. the next parameter would be +++2+++, then +++3+++ and so forth. In your formula, you can pass in parameters in one of 2 ways:
- A comma-separated string like this:
=run("chuck","3,param2,param3",$A$1) - A cell reference like this:
=run("chuck",C1:E1,$A$1), where cellsC1:E1contain the values you want to pass in.
That's it!#
Congratulations, you just ran your first parameterized query! If you have any questions or need to connect to a specific data source, please open an issue and we'll add it here.