How to Get data with Google Sheets?

Read this article to learn how to get data from a spreadsheet.

You can perform this action to search in a line of your Spreadsheet, using the column you selected as a reference (Reference Column). Botgate will receive the information if Google Sheets finds the value in that row. And then, you can save this information to an attribute to use later.

google-sheets-get-edit
  1. First, search for a value collected from visitors (Reference): You must check if a value (saved in an attribute) is existent in a certain column of the Spreadsheet. (For example, search for , in the column A - NAME ). This is where the Spreadsheet starts looking for the information. After it finds the information, it will continue the search from left to right, in the same row (line).
  2. Once you have chosen the value to start looking for in a row, you can get a value from a determined column (still in that same row), sending this value to Botgate (for example, get from the column D - EMAIL the value saved in the variable contact.email).

Outputs

There are two possible outputs from the Google Sheets step when you are trying to Get Data from a Sheet:

google-sheets-get-card

  • Success (Green output): Step triggered when the value we are searching for (step 1) exists in the Sheet, and we were able to get the information and send it into Botgate.
  • Fail (Red output). Step triggered, but the variable we are searching for does not exist in the Spreadsheet. So it was not possible to get the information (since we did not find this row).

Example

This is how we set the Spreadsheet:

Please pay extra attention to the fields from the columns NAME and COMPANY NAME.


This is how we set the steps:

google-sheets-get-flows

Reference Column: We want to use the user's name, saved in the attribute {{ contact.name }}, as a Reference Column to find the information in this row.

So we used the column NAME as a reference, and the value that we can find in the attribute {{ contact.name }} 

Get data: Starting searching in the column where we find the user's name , we will then get the information from the column EMAIL , with the value kept in the attribute {{ contact.email }} 

Please note that the Spreadsheet will not be changed, because we are GETTING information from it, instead of inserting or updating.