Google Sheets - How to get started with Google Sheets in Automations
This article gives an overview of the available blocks in the Google Sheets connector in Qlik Application Automation. It will also go over some basic examples of creating a new spreadsheet, adding new sheets to it, adding some information to the sheet as well as removing information from it.
You will find the mentioned example attached to this article in JSON format so you can upload it to your workspace and get started with it easily.
This connector supports operations to manage spreadsheets, adding/removing sheets from spreadsheets, manipulating sheet data, and a few other support operations.
From the left menu, select the Google Sheets connector;
Drag and drop the "Create Spreadsheet" block and fill in a title for the spreadsheet we will be adding
Let's go ahead and drag and drop the "Add Sheet to Spreadsheet" block and fill in the input parameters. (input parameter for the spreadsheet id can be filled manually by clicking the input and using the do lookup function for adding a new sheet to an existing spreadsheet or filled in from the output of the block before this one like shown in the picture)
Next step in our example was to append a couple of rows and columns to our newly added spreadsheet in one go by using the 'Append Rows to Sheet' block:
For text values you can encase them between double quotes and for number you can simply send them as they are. The end result should look like the following picture in you document:
Now in order to get the data from the spreadsheet we've used the block 'Get data from sheet with Headers' and the resulting output from that block will be a list object ( if there were multiple lines ) with the headers used as keys of the object and the values taken from the following lines.
Lastly we used the 'delete rows' block in order to delete 1 line from our sheet. Just as you can see on the block description, you are not allowed to delete all rows in a sheet.
In the presented JSON example, you will notice a disabled 'Delete Spreadsheet' block as well. That block is only available for accounts whose administrator has whitelisted the app beforehand in their G Suite administration panel, so not every user might have access to that blocks functionality. If you want to delete a spreadsheet and don't have the possibility from our Google Sheet connector, manually deleting the spreadsheets from your account is the only way to do it.
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.