Fetch Data from Google Sheets & Create Dynamic Buttons/List

This guide explains how to fetch user data from Google Sheets and display it as dynamic buttons or lists in a bot flow.

Step 1: Create Bot Flow

  1. Go to Chatbot → Create Botflow

  2. Add trigger (keyword)

  3. Select channel and save

Step 2: Capture Phone Number

  • Ask user if their WhatsApp number is the billing number

    • If Yes → Save WhatsApp number

    • If No → Ask for billing number and save input

Step 3: Fetch Data from Google Sheets

  1. Add Automation → Google Sheets → Lookup Rows

  2. Select authentication and spreadsheet

  3. Enter column (e.g., Phone Number column)

  4. Set condition (equals)

  5. Map phone number variable

  6. Run once and then Save

Step 4: Store Retrieved Data

  • Save:

    • Number of rows found

    • Full response data

  • Use Bot Fields for storage

Step 5: Apply Conditions

  • If no data found (rows = 0)

    • Send message: No complaint found

    • Redirect user (Go To block)

  • If data found (rows > 0)

    • Proceed to next step

Step 6: Create Dynamic List

  1. Add Interactive Message

  2. Select Dynamic List

  3. Map:

    • Title → Name

    • Description → Complaint Number

    • Value → Unique field (e.g., Complaint Number)

  4. Save user selection

Step 7: Show Complaint Status

  • Send message with mapped complaint status

  • Save and Enable workflow

Last updated

Was this helpful?