Google Sheets - Create Rows
Introduction
Byteline provides a Google Sheets - Create Rows node to populate the Google Sheets.
Create Google Sheet - Create Rows 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 - Create Rows node with any trigger. For more detail, you can check How to create your first flow design.
Step - 1. Click here on the add button to add a node to the flow.
Step - 2. Select the Google Sheets - Create Rows 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. Select your spreadsheet. You can use the spreadsheet ID under each name to verify the correct file is selected.
Step - 8. Pick the sheet name in the field 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.
Formula used: =SPLIT(indirect(address(row(),column()-1)), ",")
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.