Connect a flow to Google Sheets

Build a flow that asks users for their name, phone number and address with Get User Data, then saves every answer to a Google Sheets spreadsheet automatically.

15:20 video10 stepsUpdated 2026.10.01

When you take orders or registrations, the chatbot can ask users for details such as their name, phone number and address, and write the answers to a Google Sheet automatically. This guide builds a flow that asks three questions with Get User Data content and saves the answers to a spreadsheet named “Test”. Before you start, your Google account must be connected in the Google Sheets integration under Settings (Тохиргоо).

The video shows the panel in English. In the Mongolian panel the same menus and buttons have Mongolian names.

Prepare the Google Sheet

In Google Sheets, click Blank spreadsheet to create a new spreadsheet and give it a name (“Test” in the example).

In the first row, type a column title for each piece of information you want to collect. The example has four columns:

  • “Нэр” (Name)
  • “Утасны дугаар” (Phone number)
  • “Хаяг” (Address)
  • “Бөглөсөн цаг” (Time filled in)

The chatbot adds each user's answers as a new row under these titles.

Create the flow and write the first message

In the left menu, open Flows (Өрөлт) and click Add (Нэмэх) to create a new flow. In the example the flow is named “Google sheet”.

Click the Send Message (Мессеж илгээх) block under Start (Эхлэх) and choose Messenger from the Message Type (Мессежийн төрөл) list. By default it is set to Omnichannel.

Then type the first message the user receives, for example “Та мэдээллээ оруулна уу” (Please enter your information).

Ask for the name with Get User Data

In the same block, click Add Content (Контент нэмэх) and choose Get User Data from the list. Type your question in the field that appears, for example “Таны нэр?” (Your name?).

Click Edit (Засах) under the question and set the following:

  • Reply type: the kind of answer you expect from the user. For a name, choose Text (Текст).
  • Save response to a custom field (Хариуг тусгай талбарт хадгалах): the field that stores the answer. Click Add New (Шинээр нэмэх), type a name for the field in Name (“ner” in the example) and click Continue (Үргэлжлүүлэх).
  • Skip Button Label: optional. In the example the pre-filled word “Skip” is deleted and the field is left empty.

Click Save (Хадгалах). On the block, Awaiting user reply and Data was saved appear under the question.

Ask for the phone number

From the first block's Continue output, add and connect a new Send Message block, and set its Message Type to Messenger as well.

Choose Add Content → Get User Data, ask “Таны утасны дугаар?” (Your phone number?) and click Edit. The Reply type list includes types such as Number, Phone, Email and Date. The example first picks Phone, then changes it to Number and saves the answer to a field named “dugaar”.

With a type such as Phone, a Retry message if the reply is invalid field appears. Type the message to send when the user's answer is not valid, for example “Та дугаараа шалгаад дахин оруулна уу” (Please check your number and enter it again).

Ask for the address

Add the next Send Message block in the same way and type “Таны хаяг?” (Your address?) in its Get User Data content.

Set Reply type to Text, click Add New to create a field named “hayg” and click Save. You now have one question for each of the “Нэр”, “Утасны дугаар” and “Хаяг” columns.

Add the spreadsheet to the panel

In the left menu, open Settings and click Google Sheets in the Integrations (Интеграци) list. The email address of the connected Google account is shown below it. Click Manage (Удирдах).

The Spreadsheet page lists the spreadsheets registered in the panel, with Name and link columns. Click Add, give your spreadsheet a name (“test” in the example) and paste the link of your Google Sheet, copied from the browser's address bar. The spreadsheet is added to the list.

Save the time of the answers in a custom field

To fill the “Бөглөсөн цаг” column with the time the user answered, first save that time in a custom field. Add a new Send Message block after the last question and set its Message Type to Messenger.

Choose Add Content → Actions (Үйлдэл) → Set Custom Field and fill it in as follows:

  • Custom Field: click Add New to create a new field. In the example Name is “bichsen tsagminut” and Type (Төрөл) is Text.
  • Operation: choose Set to.
  • Value: type {{current_user_time}}.

Click Save. The block now reads “Set bichsen tsagminut to {{current_user_time}}”.

Add the Google Sheets action and match the fields

Use the + button at the bottom to add an Actions block. In the left panel, click Add Content and choose Google Sheets.

Fill in the Google Sheets window as follows:

  • Actions: choose Send data.
  • Spreadsheet: choose the spreadsheet you added in the earlier step (“test” in the example). There is also an Add New link next to this field.
  • Worksheet: choose the sheet inside the spreadsheet (“Sheet1” in the example).
  • Custom Field and Google Column Titles: each title you typed in the first row of your sheet appears on the right. For each title, choose the field that holds that answer from the list on its left.

The example is matched like this:

  • “ner” → “Нэр”
  • “dugaar” → “Утасны дугаар”
  • “hayg” → “Хаяг”
  • “bichsen tsagminut” → “Бөглөсөн цаг”

Besides the fields you created, the list has built-in ones such as First Name, Last Name, Full Name, Email and Phone. If the list is long, type the field's name in its search box.

Click Save, then connect the Continue output of the block that saves the time to this Actions block. The block shows Google Sheets, Send data and two outputs, Success (Амжилттай) and Failed (Амжилтгүй).

Publish and test the flow

When all the blocks are connected, click Publish (Нийтлэх) in the top right corner.

Above the first block, next to Start, click the Get Published Link (Нийтлэгдсэн линк авах) icon. The flow opens in Messenger. Answer each question, for example “smartbot”, “72114700” and “peace mall”.

Then open your Google Sheet. The answers have been added as a new row under the titles.

If you like, add a Send Message block with a thank-you message at the end of the flow, such as “Мэдээлэл бөглөсөнд баярлалаа.” (Thank you for filling in your information.) In the example this block sits between the block that saves the time and the Google Sheets action block.

Format the time column

In the Google Sheet, the value in the “Бөглөсөн цаг” column may show up as a number such as 45579.61389.

Select that cell or column and choose Format → Number → Date time in Google Sheets. The value then shows as a date and time, for example 10/14/2024 14:54:00.

If a custom field you just created does not appear in a list, reload the page.

You do this in the Chatbot panel.new-cp.smartbot.mn

Open Chatbot panel