Google Sheets - Insert
Byteline provides a Google Sheets - Insert node to populate the Google Sheets.
Create Google Sheet - Insert node
For this document, we are assuming that a flow has been initiated with the Scheduler node and followed by Reddit - Get Subreddit Posts node. But you can use a Google Sheets - Insert node with any trigger. For more detail, you can check How to create your first flow design.
Step - 1. Click here the add button to add node the flow.
Step - 2. Select the Google Sheets - Insert node from the select node window.
Step - 3. Sign into Google Sheets Click on the sign-in button on the configuration window of the update/insert Google Spreadsheet values node.
Step - 6. After signing in, Click the "Refresh" button to see if the connection was successful.
Step - 7. Open your Google spreadsheet and copy the spreadsheet Id from Google Sheet URL and paste it in the Spreadsheet Id field. See the below section on how to find the spreadsheet ID.
Step - 8. Enter the sheet name in the field below.
How to find the spreadsheet Id of your spreadsheet?
Step 1: Open the Google Sheet in which you want to insert the data.
Step 1: Copy the spreadsheet Id from the spreadsheet URL, as shown below:
Add a header row
You're required to have a header row before using this node. The labels used in the header row are shown in Byteline to map the expressions. Below is a screenshot of a spreadsheet with a header row.
If the header row is missing, you'll see a validation error:
The header row is not found in your Google Sheets. Please add it and then retry.
Using Google Spreadsheet functions
If you need to use Spreadsheet formulas in your Google Sheet and use the Byteline's Google Sheets - Insert task, you can add those formulas to the Byteline task. It's even more important to do that with Clear values from Spreadsheet option, as otherwise, your manually added functions will be overwritten on the next run. You can use the Spreadsheet functions as the values in the Byteline task's field mapper used to configure the value expression.
Below is an example function that splits comma-delimited image URLs into different columns. The formula uses dynamic values for the rows and columns. This example discusses the split function, but you can use the below methodology for any Spreadsheet function.
Below is the explanation for various parts of the function
SPLIT: This function takes a cell reference and a delimiter and splits the values. It's generally written as SPLIT(B1, ",")
indirect: Indirect function converts text value to a cell reference.
address: Given a number-based row and column, this function returns the text representation of the cell reference. For example: "$B$1"
row: This function is used to find the current row
column: The function is used to find the current column.
In brief, this formula takes the comma-delimited images from the column left to it and performs a comma-delimited split.