FB Messenger DM reply using google sheets data
Status: Closed · Asked by Milind Natu on · 0 views

Hi Milind,
Thank you for explaining your use case in detail. Based on your requirement, we suggest slightly changing the workflow logic so that the system first understands the customer's message and identifies their intent and the information they have already provided.
For example, if a customer simply says:
“Hi, I want to buy a property.”
There is no specific requirement available yet. In this case, the workflow should not search the Google Sheet. Instead, the AI should respond naturally by asking for the required information, such as:
Preferred location/locality
Property type (2 BHK, 3 BHK, shop, plot, etc.)
Budget
Mobile number
However, if the customer says:
“I am looking for a 2 BHK in Vijay Nagar. My budget is around ₹50 lakh.”
The workflow should first extract the information already provided in the customer's message. It should then identify what information is still missing, if any, and ask only for the missing details.
Once all the required information is available, the workflow can proceed to the Google Sheets – Get Rows step and retrieve the relevant property records based on the customer's requirements. The retrieved property data can then be passed to the OpenAI/ChatGPT step, which can generate a natural and concise response for Facebook Messenger.
So, the recommended flow would be:
Facebook Messenger → AI/Intent & Requirement Analysis → Check Required Information → Router/Filter
If information is missing:
→ Ask the customer only for the missing details → Wait for the next message
If all required information is available:
→ Google Sheets – Get Rows → Filter/Match Properties → OpenAI/ChatGPT → Generate Reply → Facebook Messenger
This approach will make the automation more conversational because the AI will first understand what the customer wants and what information they have already provided, instead of asking the same questions every time.
Your current prompt is trying to handle all of these scenarios inside a single AI step. It would be more reliable to divide the process into these stages and pass the output of each stage to the next step.
For the OpenAI step that generates the final reply, you can then provide the customer's message, extracted requirements, and the matching property data from Google Sheets. The AI should be instructed to use only the information provided by the workflow and generate the exact message that should be sent to the customer.
This structure should be more suitable for the use case you described and will also make it easier to manage different types of customer inquiries.
Thanks & Regards,
Soumya Tripathi
Customer Support Lead
🌐 Pabbly.com
Dear Soumya Ji,
Thank you for prompt reply. How to do "AI/Intent & Requirement Analysis", which module should I use to do this?
Hello Milind,
You can use the OpenAI/ChatGPT step for the AI/Intent & Requirement Analysis.
In this step, you can provide the customer's message and instruct the AI to understand what the customer wants, identify which required details are already available, and determine what information is still missing.
If all the required information is available, the same OpenAI/ChatGPT step can generate the direct reply to the customer based on the matching property details received from Google Sheets.
Thanks & Regards,
Soumya Tripathi
Customer Support Lead
🌐 Pabbly.com
Hello Soumya Ji,
I was able to put filters & set a route. The first route for "Customer's information not available" is working fine now. Its sending a "information needed request" to messenger successfully.
But I am facing issue with "Customer's information available" route. I connected the Google Sheets – Get Rows but facing issues with Filter/Match Properties. Can you put more light on this? My filter is not giving any result. Means, the customer's information is not getting matched with data in google sheet.
Hi Milind,
Thank you for sharing the details. We’ve reviewed the current setup.
In your Route 2, after the Google Sheets – Get Rows step, you do not need to add the Filter (Pabbly) step. You can directly proceed with the OpenAI step to generate the response based on the property data returned from Google Sheets.
Your next flow can be structured as follows:
Google Sheets – Get Rows → OpenAI – Generate Response → Router
After the OpenAI response-generation step, add a Router with two routes:
-> Route 1 – Response is Queued
Add a filter to check whether the ChatGPT response status is “Queued.”
If the response is queued:
ChatGPT – Response Queued → Get Response by ID → Facebook Messenger – Send Message
The Get Response by ID step will retrieve the generated response once it is available, and you can then pass that response to the Facebook Messenger step.
-> Route 2 – Response is Generated
For the second route, add a filter to check whether the ChatGPT response has been generated/completed.
If the response is already generated:
ChatGPT – Response Generated → Facebook Messenger – Send Message
In this case, you can directly map the generated ChatGPT response into the Facebook Messenger Send Message step.
So, the overall structure after your Route 2 should be:
Google Sheets – Get Rows
↓
OpenAI – Generate Response
↓
Router
↙️ ↘️
Response = Queued Response = Generated
↓ ↓
Get Response by ID Facebook Messenger – Send Message
↓
Facebook Messenger – Send Message
This way, you don't need to manually filter the Google Sheets rows at the stage. The property information retrieved from Google Sheets can be provided to the ChatGPT step, and ChatGPT can generate the appropriate response based on the available property data.
Please try setting up the flow this way, and if anything is unclear or you face any issue while configuring any of these steps, please let us know. We’ll be happy to guide you further.
Hi Vinay,
Thank you for your help. I edited the flow as per your instructions. Now when I "save & test the flow", it is giving response for "queued" messages only under "save & test the flow" condition. On live message, a queued response doesn't get delivered to customer. Please guide.
Also, for message status = complete, I am not able to set the condition as I am always getting status as "queued"
Hi Milind,
Thank you for sharing the update.
We noticed that you’re using ChatGPT – Get Response by ID. Since the AI response may not be generated immediately, there is a possibility that the response is still in Queued status when the next step is executed.
To allow sufficient time for the AI response to be generated, please add the Delay step before ChatGPT – Get Response by ID and set a significant delay of around 5–10 minutes.
The flow should be:
ChatGPT – Generate Response → Delay (5–10 minutes) → ChatGPT – Get Response by ID → Facebook Messenger
After adding the delay, test the workflow again. This should give the AI sufficient time to generate the response, allowing you to receive the Complete status instead of consistently getting Queued.
Please try this setup and let us know if you still face any issues.

Hi Milind,
Just following up to check whether you were able to add the 5–10 minute Delay step before ChatGPT – Get Response by ID and test the workflow again.
Please let us know if the response is now being received with the Complete status or if you’re still facing the issue.
Hi Vinay,
Regret delay in reply. Just added the delay before "OpenAI get message ID". Let me chec the execution and revert.
Hi Milind,
Sure, no problem.
Please check the execution after adding the Delay step before “OpenAI Get Message ID”. If you face any further issue, please let us know and we’ll be happy to assist.
Hi Milind,
Just following up to check if you’ve added the Delay step before “OpenAI Get Message ID” and verified the workflow execution.
Please let us know if the issue is resolved or if you’re still facing any difficulty
Hi Vinay,
Its working! Thanks for the support!.
Hi Milind,
Glad to know that the issue is now resolved.
We’ll be closing this thread for now. If you need any further assistance, please contact us at support@pabbly.com.
We would also greatly appreciate it if you could share your feedback on your support experience using the following link: https://bit.ly/3V2Pjia
