Using Google Sheets in Flow XO, Part 2

Lydia Husser
Mar 29, 2017 · 8 min read

In Part 1 of this tutorial, we covered how to use Flow XO to search, add, and update information in Google Sheets. This tutorial will show you how you can use Google Sheets with even more features in Flow XO.

If you don’t already have a free Flow XO account, get yours now.

In the last tutorial, you created a mailing list bot for a bakery. You set up a flow to collect and verify contact information from your customers. Now you can build on your bot. In this tutorial, you’ll learn a time-saving way to use Google Sheets when you respond to grouped words or phrases. You’ll also learn how to use Google Sheets to make a card set that will be quick to update later.

Respond to Grouped Words or Phrases

In Flow XO, you can use groups to categorize words or phrases you might expect from users. You can then account for variable wording with a single response.

For example, this New Message trigger accounts for different ways users might send a greeting, request hours, or ask for a phone number. The bracketed word next to each message is the group:

With Google Sheets, you can set up a spreadsheet that contains a response to each group. This can save you time when you set up your flow. Instead of creating a new action for every response, you can create just two actions: one to search your spreadsheet and one to send the response.

Set Up Responses in Google Sheets

Remember, always set up your spreadsheet before you use it in your flow. Flow XO needs an existing spreadsheet with a header row as a reference point.

Follow these steps to create a spreadsheet that contains a response to each group in your trigger.

  1. In Google Sheets, create a new spreadsheet and give it a clear name.

All of your responses are now in one place. Later, if you decide to add more groups and responses, you only need to update the trigger and the spreadsheet. Because of what you’ll do in the next steps, any new responses won’t require new actions in your flow.

Search Rows for a Response

By now, you should have a trigger with grouped words or phrases and a spreadsheet with corresponding questions and answers. Now you’ll want your bot to respond to the user with an answer from your spreadsheet.

First, you need your bot to search your spreadsheet for the group that corresponds to the user’s input. For instance, “hello” is in the [greeting] group. If the user says “hello”, your bot should search for “greeting” in your spreadsheet. Here’s how you can do this:

  1. In your flow, add an action. Select Google Sheets → Search Rows, then click Next.

Your Settings window should look something like this:

Click Next, then finish and save the action. When this action runs, your bot will search the Question column of your spreadsheet and find the group that matches the trigger output.

Send a Message

Next, your bot should display the Answer on your spreadsheet that corresponds to the Question it found in the last step. To do this:

  1. In your flow, add an action. Select Bot → Send a Message, and click Next.

Here’s what the Send a Message window should look like:

Your bot will send a response from your spreadsheet that depends on the trigger output. So, if the user sends a greeting, your bot will reply with the text in the greeting row, Answer column.

With this setup, your bot can respond to any input from the user with just two actions. As long as there is a group in the trigger and matching group in your spreadsheet, your bot will always have the right response.

Send Cards with Google Sheets

In Flow XO, you can also use Google Sheets to send a card set to users. With cards, your bot can send links and captioned images. If you want to change card content regularly, it can be helpful to keep data in a spreadsheet rather than editing your flow directly.

For example, you might want your bakery bot to display weekly specials as a card set. You can set up your flow once, and change the specials each week in Google Sheets.

Set Up Cards in Google Sheets

The first step is to set up a spreadsheet for cards. You’ll input the same data you would in a normal card set. But, instead of putting it directly in your flow, you’ll put it in a spreadsheet. To do this:

  1. Create a new spreadsheet in Google Sheets and give it a clear name.

The next step is to log this data so you can use it in your flow.

List Rows

To log your spreadsheet data, use the List Rows action in your flow. This action will read and log the entire spreadsheet so that you can use all of the data in later actions. Here’s how you can set this up:

  1. In your flow, add an action. Select Google Sheets → List Rows, then click Next.

When this action runs, your bot will read all of the data in the spreadsheet. You’ll use this data in the next action.

Send a Card Set

Now you can set up a card set. You’ll use the output from the List Rows action in the fields for each card. To do this:

  1. In your flow, add an action. Select Bot → Send a Card Set, and click Next.

In the Card Title field, type {{. Then, in the drop-down menu, find the output from your List Rows action. Select the column that you want to take the card title from, in this case Special:

As soon as you select a column, the Special Modifier window will pop up. Here is where collection outputs come in. In this case, your spreadsheet is the collection.

  • For the first card, you want your bot to look in the first row of the spreadsheet. The first row is item 1 of the collection.

Note: If you leave the Special Modifier blank, it will default to 1. You can either type “1” or leave a blank for the first row. You must specify a collection output for all other rows.

When you press Enter, your first Card Title will look like this:

Complete the rest of the fields in the same way. Use your Price column in the Card Text field and your Image column in the Card Image URL field:

To add the next card, click + Add Card. For the second card, follow the same steps but change the collection output to 2. For the third card, change the collection output to 3.

Now your bot can read the data on your spreadsheet and send it to the user as a card set.


In Flow XO, Google Sheets can help you save time when you create a flow and when you update it later. In addition to collecting data, you can use Google Sheets to respond to users and even send images.

Want to find out more? We have full documentation for Google Sheets and other features in Flow XO over at our Help Center, or get help & advice from other Flow XO users on the Community Site.

Flow XO

Smart chatbots made simple. We share tutorials and ideas to help you build amazing bots.

Thanks to John Jackson

Lydia Husser

Written by

Flow XO

Flow XO

Smart chatbots made simple. We share tutorials and ideas to help you build amazing bots.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade