Initial concepts
So, what we can do with the Platform?
How do I know if my company needs a chatbot?
Register and login
First Steps - Creating your project
Choose your plan
Profile
Permissions system
Project Dashboard
Platform's Glossary
2-Factor Authentication
Invalid authentication code
General settings
Artificial Intelligence
Zero Shot Learning
WeniGPT
What is the Weni Platform's AI Module?
Overview
What is an Intelligence?
Intents and Entities
Hands-on
Creating an Intelligence
Training your Intelligence
Intelligence Force
Tests
Inbox
Translating your dataset
Share your AI with translators
Requesting authorization
Versions
Settings
Integration
Integrate an intelligence to your project in the Weni Platform
Introducing the Content Intelligence
Integrating a Content Intelligence
Updates
Glossary
Guidelines and Good practices
Flows
Expressions and Variables Introduction
Variables Glossary
Expressions Glossary
Flows Creation
Flows introduction
Flow editor and tools
Action cards
Decision cards
Adding Media to the message
Call Webhook: Making requests to external services
Split by Intent: Using Classifiers
Import and export flows
Using expressions to capture the user's location
Viewing reports on the platform
Route markers
Studio
Contacts and Messages
Groups
Messages
Triggers and Campaigns
Adding a trigger
Triggers Types
Tell a flow to ignore triggers and keywords
Campaign introduction
How to create a Campaign
Editing events
Creating contact from an external Webhook
Contact history
How to download, extract, transform and combine archived data from Weni Flows
Channels
Settings
Channels Introduction
Adding a Facebook Channel (RapidPro)
Adding a Viber channel
How a SMS Integration Works
General API concepts and Integrations
How to create a channel on twitter
How to create a channel on Instagram
Main steps to active Whatsapp for UNICEF
Adding Discord as a channel
Creating a Slack Channel
Adding a Viber channel (RapidPro)
Creating a Microsoft Teams channel
Weni Integrations
How to use the integrations module
Adding a Web channel
Adding a Telegram channel
How to create a channel with whatsApp demo
Whatsapp: Weni Express Integration
How to create template Messages: Whatsapp
Creating a Microsoft Teams Channel
Whatsapp Business API
Integrations
Human Attendance
Weni Chats: Introduction to the Chats module
Weni Chats: Setting Up Human Attendance
Weni Chats: Human Service Dashboard
Weni Chats: Human Service Management
Weni Chats: Attendance distribution rule
Weni Chats: Using active triggering of flows
Weni Chats: CoPilot
Ticketer: Ticketer on Rapid Pro
Ticketer: How to integrate Rocket.Chat as a ticket service on the Weni Plataform
How to send message templates through RocketChat
RocketChat call routing
RCAdmin API: Agent-Activity
U-Partners - Proper use of features
Using groups to organize human attendance
Data and BI
How to Install and Use the Weni Data Connector for Power BI
Incremental Update - Power BI
Explore Weni's Database Documentation
Tips for Data Modeling in Power BI
Filter using Contact Fields in Power BI
UX Writing
- All Categories
- Flows
- Using expressions to capture the user's location
Using expressions to capture the user's location
Updated by Sarah Pinheiro
In this article we will see a practical example of how using expressions and variables can be useful for your chatbot. Here, we will focus on a very simple example, but also can be very useful for everyone: Being able to capture the user's location by the conversation, and can use this data later.
Step one: Identify the channel
How to capture the location changes depending on the channel you are using on the platform.
Web channel:
To capture a user's location via the web channel, simply create a "Send Message" action letter with a "Quick Reply" with the prefix "[Loc]", so the user can reach that button, we can capture the location via browser. After that, simply save the result in the "Wait for response" decision letter.
The message received by the web channel will always begin with: "My Location is:", followed by the user's latitude and longitude in the format "[latitude, longitude]". To remove these prefixes, simply use the expression @(replace) and then separate the latitude and longitude values into different variables, using the @(split) expression to separate using the comma (",") that separate them as a parameter.
Telegram channel:
To send the location via telegram, the user needs to click the button 📎, select "Location" and then "Send my current location".
With this, simply create a "Wait for response" decision letter and save the value. The telegram sends the location in the format "latitude, longitude", not needing to do the process of using @(replace) to remove texts, only separate using split as in the web channel.
Whatsapp Channel:
To send the location via whatsapp, the user needs to click the 📎 button or ➕ the , select "Location" and then "Fixed location".
Unlike other channels, the location via whatsapp does not come as text, but as an attachment, so we need to access it using the variable: @input.attachments.0
This variable is the location in the format "geo: latitude, longitude", so we need to use the expression @(replace) to remove the "geo:" and then use @(split) to separate latitude and longitude like the other channels.
Thus, we were able to create a flow with support to capture the user's location on three different channels, using the expressions and variables available on the platform.