Any suggestion or sample on how to get location from a web bot?
Web bot - get location
Hi there,
A quick and easy way to get started on using locations would be to install our âFind Locationâ template.
Log into Flow XO -> Click the Flows tab -> Click Add New Flow and youâll see all the templates here.
Karen,
The question is how to GET the location.
The example starts from moment the user has send its location.
Ah I seeâŚ
Unfortunately it isnât possible for the bot to get the users location itself. The user must send it to the bot for privacy reasons. Your first flow is where you request the user to send their location and the 2nd flow is waiting to receive the users location (template) and then continue with your flow. If you filter the 2nd flow on the file type then this will ensure that only location file types trigger this flow.
Karen I am lookin exactly what you describe about capturing the location the user sends within the first flow, and then triggering it to the second location template flow, then get back to the beggining of the first flow. I have the location flow working, and it is attached to the same telegram bot as the first flow that asks the user to send his location. But whenever I ask the location on a question in the first flow, I send my location but the location template flow appears not to be listening for the location file unless I detach the first flow and leave the location template flow alone.
It sounds like youâre getting stuck inside âAsk a Questionâ - if you try and send your location when answering a question it treats it as an answer rather than triggering the find location flow. The user needs to send their location whilst not answering a question.
Ok, got it, nevertheless how do you guide the chatbot user to a point where you ask him or her the location without a question or prompt to do so and wait for his or her location answer?, A card or an options menu will require a question always. Kinda conundrum.
Hi Augusto,
You can use a custom request to send the user a location request button.
For Telegram the following request should work:
{
âchat_idâ: â{{bot_new_message.channel_id}}â,
âtextâ: âHello Worldâ,
âreply_markupâ: {
âkeyboardâ: [
[{
âtextâ: âSend Locationâ,
ârequest_locationâ: true
}]
]
}
}
Metadata
Method SendMessage
On Facebook Messenger it would be a custom request using the following:
{
âtextâ:âPlease share your location:â,
âquick_repliesâ:[
{
âcontent_typeâ:âlocationâ
}
]
}
Thanks Daniel, I inserted a custom request after calling a label when the user selects âENCUENTRA UN SEVENâ, it displays then a brief moment the SEND LOCATION button, only to dissapear and get back to the main menu. Âżhow do I pause the flow in order to wait for the user to send their location? I tried with a question, but as you pointed out the answar gets trapped in the question so the location is not sent to the listening subflow in charge of finding the nearest locations. Maybe I can share the flows. The chatbot is located here:
https://m.me/718180008384257
Youâll need to stop the flow once the location button has been sent since the user needs to trigger the location flow. You can use a filter on the action to send the location button with the option enabled for âAlso stop rest of flow if conditions are metâ
If you need to send the user back to a specific point in your flow after that then you could make use of a combination of Attributes and Flow Labels. For example, set an attribute on your location flow for something like âGotLocation = Trueâ and then at the start of your main flow have a filtered GoTo Label Action for âGotLocation = Trueâ
@Augusto_Vera
I found your post in the community and tried your flow.
Is you location routine still working? Did the flow fail?
I donât think Facebook is sending the send location button. I tried manually sending location and your flow continued as expected.
Regards Andrew