The Filter element in chatbots
Use a filter and separate your audience by their interests, customer status, or other personal data. This will allow you to send more targeted messages or interact with a contact based on their data: send webhooks to your system, open a chat with a manager, assign or update variables and tags, or launch other flows.
With the SendPulse chatbot flow builder for Telegram and Facebook, you can add a Filter element to separate customers based on their data i.e. variable values, tags, and participation in previous campaigns and flows.
Add a Filter element
Drag and drop the Filter element into your working area, connect it to the element, from which you want to start branching off your scenario.
Select a filter condition
Filtering operators and values vary depending on the condition.
Configure the condition
Some conditions are available only for specific bots.
Condition | Description | How to set it up |
Variable value |
Checks the variable value of a string, number, date, time, email address, or phone number. To compare values with other variables and filter them based on dynamic data, select the Insert variables checkbox, and choose a variable from your bot audience. |
Select an operator: contains, does not contain, equals, doesn't equal, starts with, ends with, empty, or not empty. Next, enter or select a value or its part to filter the data. |
Tags |
Checks whether the user has an assigned tag. This will help you segment your audience by benefits, interests, statuses, etc. |
Select an operator: Tag assigned or Tag unassigned. Next, select a tag to filter the data. |
Was in flow | Checks whether the user went through your selected chatbot flow so that you can hide or show it. |
Select an operator: Run or Not run. Next, select a flow to filter the data. |
Was in campaign | Checks whether the user received your selected campaign to avoid content repetition and personalize your content for new subscribers. |
Select an operator: Received or Don’t receive. Next, select a campaign to filter the data. |
Run time |
Checks the timeframe when the user was in a certain element to add special offers or show them during particular hours. This condition uses your account timezone. |
Select an operator: between, empty, or not empty. For between, enter a start and end time to filter the data. Define whether the run time has been recorded using empty and not empty. |
Run date |
Checks the date when your filter was triggered. You can also add a date range and compare dynamic data. This condition uses your account timezone. |
Select an operator: between, after, before, empty, or not empty. For between, enter start and end dates to filter the data. For before and after, enter only a start or end date or select a dynamic value. Define whether the run date has been recorded using empty and not empty. |
Day of the week |
Checks the days of the week when the user interacts with your bot. For example, you can set messages to be sent only on weekends or work days. |
Select a day of the week to filter the data. |
Sign up date | Tracks subscription dates to process old and new users individually. |
Select an operator: equals, doesn't equal, between, after, or before. For equals and doesn’t equal, set a specific date to filter the data. For between, enter start and end dates to filter the data. For before and after, enter only a start or end date or select a dynamic value. |
Chat is open | Checks whether the conversation with the user is active or not. This helps avoid message repetition in active chats. | Select an operator: Yes or No. |
Incoming messages |
Tracks the number of messages from the user to assess their interest or activity in the chat. You can compare dynamic data for this condition. |
Select an operator: equals, doesn't equal, more than, less, empty, or not empty. For equals, doesn't equal, more than, and less, enter a number of messages to filter the data. Define whether your chatbot has any incoming messages using empty and not empty. |
Unread messages | Tracks the number of unread messages from the user to keep your replies timely and up to date. |
Select an operator: equals, doesn't equal, more than, less, empty, or not empty. For equals, doesn't equal, more than, and less, enter a number of messages to filter the data. Define whether your chatbot has any incoming messages using empty and not empty. |
Last activity | Checks the date and time of the user’s last interaction with your bot to determine the best time for communication. |
Select an operator: before, after, or between. For between, enter start and end dates to filter the data. For before and after, enter only a start or end date. |
Number of followers |
Shows the number of Instagram followers the user has if they interact with your bot to improve analytics and targeting. Available only for Instagram bots. |
Select an operator: equals, doesn't equal, more than, less, empty, or not empty. For equals, doesn't equal, more than, and less, enter a number of followers to filter the data. Define whether the user has any followers using empty and not empty. |
Follows you page |
Checks whether the user follows your Instagram profile to personalize their experience. Available only for Instagram bots. A user can be subscribed to your Instagram chatbot without following your Instagram business profile. |
Select an operator: Yes or No. |
Following |
Checks whether your Instagram profile follows the user to enhance their experience. Available only for Instagram bots. |
Select an operator: Yes or No. |
Member of a channel or group |
Checks whether the user is a member of a Telegram channel or group where your chatbot is an admin to personalize your interactions. Available only for Telegram bots. |
Select an operator: Yes or No. |
Business Profile’s Contact |
Checks the flow for bot subscribers and business profile contacts processed by your bot. This condition works properly only with the Yes option for Telegram Business users. Read also: How to use Telegram Business in chatbots. |
Select an operator: Yes or No. |
Payment complete |
Checks the product payment status, which is helpful for commercial chatbots that process customer orders. Only unique, completed transactions are listed. |
Select an operator: Paid or Not paid. Next, select a transaction to filter the data. |
Language |
Checks the user’s browser language to adjust the interface and messages. Available only for live chats and Telegram bots. |
Select an operator: equals or doesn't equal. Next, select a language from the dropdown list. |
Current page URL |
Checks the user’s active webpage when they send a message to improve content personalization. Available only for live chats. |
Select an operator: contains, does not contain, equals, doesn't equal, starts with, ends with, empty, or not empty. Next, enter a URL or its part to filter the data. |
Country |
Identifies the user’s country based on IP address or phone number to tailor your content to their location. Available only for live chats and WhatsApp bots. |
Select an operator: equals or doesn't equal. Next, select a country from the dropdown list. |
Assignee | Checks whether a particular team member is assigned to the chat to delegate requests and personalize interactions. | Select a team member from the dropdown list. |
Source | Checks the user’s subscription source to optimize subscription channels. |
Select a criterion: Chat link, Subscription widget, or Not specified. For Instagram, Messenger, and WhatsApp bots, you can also select Ad and Post in social network. For Messenger bots, you can also select Messenger Online Chat Plugin. |
Comparing with dynamic values
Compare with a value from another variable
You can also compare values with other variables (of all types) and filter them based on dynamic data. Select the Insert variables checkbox, and select a variable from your bot audience.
For example, if you received a delivery address from a user and need to categorize it by city area, you can compare an address variable with a city area variable and branch your flow scenario. You can also compare the amount of ordered products with what’s left in stock.
Compare with a dynamic run or sign up dateи
You can also compare values with other system variables by date and filter data by dynamic values. Select Run date or Sign up date, click Insert variable, and choose a variable — Sign up date or Run date.
You can select Add value offset and a tracking period +
or -
from a chosen date.
For example, you can divide flow branches by comparing a run date with a purchase date + 30 days after it. Then, send your product to those in the Yes branch and send a payment reminder to users in the No branch.
Compare the number of incoming messages
You can compare the number of incoming messages with other integer variables and filter them using dynamic data. Select Insert variables and choose a variable from your chatbot audience.
For example, you can compare the number of incoming messages and the number of unread messages to allocate conversations efficiently.
Select additional conditions
Related conditions
You can also combine conditions, add links between them, and connect the operator any
or all
. Click Add list segmentation criteria and select a condition and operator.
Alternative condition
If the previous condition has NOT been met, the filter will check the following condition you create. Click Add new condition and select a condition.
If the client's data does not match any of the specified conditions, the client will follow the NO scenario branch.
Add more elements
Add additional flow elements to each of the options of your filter; if the condition is met (green dot) or not (red dot).
Continue creating your flow, then click Save or Save and Send to yourself to test the scenario. Do not forget to give the user the opportunity to return to the previous element or the main menu, so the user won’t get lost. Or add a messenger menu.
Filtering customers and their data helps you take care of them, protects them from receiving irrelevant content and, as a result, brings more positive feedback.
Last Updated: 22.08.2024
or