View Categories

Condition Step

10 min read


With Condition step, you can go to different steps/sub flows depends on conditions.

In your Condition step, click on “+ Add Condition Group” to set at least one condition group. “Otherwise” group is always there.

You can make as many condition groups as you need. The matching start from the top to the bottom, once a group matched, the system goes to a named step. When it fails to match all condition group, the “Otherwise” group will take over it. So it’s always a good practice to name a step in the “Otherwise” group even it is very unlikely to be used.

Another important thing to know is the difference between “All conditions” and “Any conditions”. It is sitting at the upper right corner of each condition group.

You can list more than 1 condition in a condition group. When you do, it matters whether you choose “All” or “Any”.

“All Condition” means to get this group matched, you will need to have all the conditions matched in the group.

However, to get a group with “Any Condition” matched, you only need to have one of the conditions matched.

Tag & Sequence Condition

For tag and sequence condition, you can choose “in” or “not in” from the “Operator”. Choosing multiple tags/sequences is allowed.

Text Variable Condition

These are all the operators for text condition.

For “has any value” and “is empty” of all variable types, when you clear a variable, the variable becomes empty. Thus, “has any value” is false and “is empty” is true for this variable.

Number Variable Condition

These are all the operators for number condition.

DataTime Variable Condition

These are all the operators for DateTime condition.

Note that you will need to put “value” always as the correct format “yyyy-MM-dd HH:mm:ss” no matter which displayed format you choose for that variable.

Please note that – “before/after” is different from “time before/after“. The former compare the whole datetime value while the latter only compare the time value.

New Date-Time Filter Conditions

The following new date-time conditions have been added to the filtering options:

  1. After x days ago
  2. Before x days ago
  3. After x minutes ago
  4. Before x minutes ago

These options allow users to filter data or users by specific activity periods, making it easier to target recent or past events for follow-ups or analysis.


1. After x Days Ago

Description

The After x days ago condition allows filtering of records or users based on activities that have occurred after a specified number of days. It’s useful for retrieving records or users whose activities or interactions happened after a certain point in time, relative to the current date.

How to Apply After x Days Ago Condition

Go to the Flow, Select Condition Node.

Now click on add Condition 

A new popup will appear where you can select last seen

Now once you click on Operator you will see the After x days ago action

You can add the desired value in the Value Field and then the condition implies accordingly 

This condition now checks if the user’s Last Seen date is more than 30 days ago

Use Cases

  • Recent Activity Tracking: Filter users or records that have interacted with your system after a specified number of days.
  • Targeted Follow-ups: Identify users who have not interacted recently, allowing for follow-up actions or campaigns.

2. Before x Days Ago

Description

The Before x days ago condition filters users or records based on activities that occurred before a specified number of days. This filter is ideal for tracking older interactions or analysing past behaviour over a defined period.

How to Apply Before  x Days Ago Condition

Similarly in the “Last seen” actions you will see 

You can add the desired value in the Value Field and then the condition implies accordingly

This condition now checks if the user’s Last Seen date is earlier than 10 days ago

Use Cases

  • Historical Data Analysis: Analyse user or record data that falls within a specific range of past activity.
  • Event Follow-up: Identify users or records whose activities happened before a certain date for retrospective analysis.

3. After x Minutes Ago

Description

The Before x Minutes ago condition filters users or records based on activities that occurred before a specified number of Minutes. This filter is ideal for tracking older interactions or analysing past behaviour over a defined period.

Similarly in the “Last seen” actions you have “After a minutes Ago”

You can add the desired value in the Value Field and then the condition implies accordingly

This condition now checks if the user’s Last Seen date is more than 30 minutes ago

Use Cases

  • Historical Data Analysis: Analyse user or record data that falls within a specific range of past activity.
  • Event Follow-up: Identify users or records whose activities happened before a certain date for retrospective analysis.

4. Before x Minutes Ago

Description

The Before x Minutes ago condition filters users or records based on activities that occurred before a specified number of minutes. This filter is ideal for tracking older interactions or analysing past behaviour over a defined period.

Similarly as above the Last seen actions you have After a minutes Ago

You can add the desired value in the Value Field and then the condition implies accordingly

This condition now checks if the user’s Last Seen date is earlier than 10 minutes ago

Use Cases

  • Historical Data Analysis: Analyse user or record data that falls within a specific range of past activity.

Event Follow-up: Identify users or records whose activities happened before a certain date for retrospective analysis.

JSON Variable Condition

These are all the operators for JSON condition.

Note – The very last 3 operators, “has item matched with …”, require the JSON to be a list of variables, not a list of JSON. In other words, if your JSON is storing a list of normal variables, these 3 operators work. They won’t work for a JSON storing a list of JSON.

Custom Input

Custom input is built for compare values in JSON variable. Search “custom input” in the if field:

Pick a value from a JSON, then you can compare it as you use the text variable condition.

Math Formula

With this operation, you can now do formula calculation directly in the Action Step – “Set Variable Value” and Condition Step – “Value”.

Math operations and function supported:

+, -, *, e, pi, PI, abs(), min(), max(), ceil(), floor(), log(), pow(), round(), sqrt(), sin(), cos(), tan()

Please note that – If the formula is invalid, the system will return 0 to number variable and empty to text variable.

ihakimi also provides the following system variables to be used inside the condition node.

Email

These relate to the email nodes where a specific email node is sent/delivered/clicked.

ConditionExplanation
Email ClickWhether a specific email is clicked
Email OpenedWhether a specific email is opened
Email DeliveredWhether a specific email is delivered
Email SentWhether a specific email is marked sent
Opted-In for EmailWhether a bot user has been opted-in for emails

True/False Conditions (Boolean)

These refer to the booleans variables whether a condition or variable is true or false

ConditionExplanation
Subscribed to botWhether a bot user is subscribed to bot or isnt
Has Interacted in last 24hWhether a bot user has interacted in last 24 hours of the last interaction
Is Guest UserWhether a user is a guest user
Is TesterWhether the user is a tester
Is AdminWhether the user is an admin
Is assigned to agentWhether the bot user has an assigned agent
Has SSO user connectedWhether user has SSO connected
Is Business HoursWhether the time of interaction is within specified business hours
Is assigned agent onlineWhether the bot user’s assigned agent is online or not
Has agents onlineChecks if any live agent is assigned or not

Integer/Numerical Conditions

ConditionExplanation
Opted-In Date (minutes ago)Represents minutes since the bot user has subscribed to bot
Last seen (minutes ago)Represents minutes since the bot user has last seen the message sent by the bot
Last interaction (minutes ago)Represents minutes since the bot user last interacted with the bot flow
Last agent interaction (minutes ago)Represents minutes since the live agent last interacted with the bot user
Opted-In for Email (minutes ago)Represents minutes since the bot user has been opted in for email
Opted-In for SMS (minutes ago)Represents minutes since the bot user has been opted in for SMS
Shopping cart total priceRepresents the total price of the cart present in ORDER JSON system,field
Agent IdSystem ID of the live agent
Last FB Comment is existing user 
Last FB Comment total new tagged user 
Last FB Comment total tagged users 

Date/Time Conditions

ConditionExplanation
Opted-In DateDate of the user’s opt in
Last SeenDatetime field representing the last seen of the bot user
BOT_CURRENT_TIMECurrent time in present represented in workspace timezone
Created AtDatetime field representing the timestamp the bot user was created
Last InteractionDatetime field representing the timestamp of the last interaction by the bot user
NOWCurrent time in present represented in UTC time
SubscribedDatetime representing the timestamp the bot user subscribed to the bot
TODAYDate field representing the date today

System Fields Conditions

ConditionExplanation
Agent EmailRepresents the email of the assignedagent
Agent NameRepresents the name of the assigned agent
BrowserRepresents the browser through which the user is interacting with the bot on web channel
CRM Contact IdRepresents the unique Id assigned by the integrated CRM. (for eg GHL, Zoho etc)
ChannelRepresents the channel via which the bot user is interacting with bot
CityRepresents the city of the bot user
CountryRepresents the country of the bot user
DepartmentRepresents the department you want to assign the bot user
DeviceRepresents the device via the bot user is interacting with the bot
EmailRepresents the email of the bot user
First NameRepresents the first name of the user
Flow NsRepresents the the current mainflow Ns of the bot
GMB NameName of the GMB Location
GMB Place IdId of the GMB location
GTAG Client Id 
GTAG Session Id 
GenderRepresents the gender of bot user
IPRepresents the the IP of the bot user on web channel
Instagram IdRepresents the Meta assigned unique ID of the bot user on Instagram
Instagram User NameRepresents the Meta assigned user name of the bot user on Instagram channel
InterestRepresents the interest of the bot user you cn assign
LanguageRepresents the language of the bot user
Last Button TitleRepresents the last button the user clicked
Last FB CommentRepresents the last comment made by the user on Facebook channel
Last FB Comment IdRepresents the Id of the last comment made by the user
Last FB Comment Post IdRepresents the Id of the post on which the last comment was made by the user
Last NameRepresents the last name of the bot user
Last Node NsRepresents the Ns value of the node last visited by the bot user
Last Text InputRepresents the last text input bot user entered
Lead SourceRepresents the source of the bot user you can assign 
Lead StatusRepresents the status of the bot user you can assign
Live Chat UrlRepresents the URL link of the livechat of the bot user
LocaleRepresents the locale of the bot user
MarketRepresents the market of the bot user you can assign
OpenAI Thread IdRepresents the current thread Id by the assistant run from OpenAI
Page IdRepresents the Id of the facebook page
Page NameRepresents the name of the facebook page integrated
Page User NameRepresents the user name of the facebook page’s admin who integrated the page with ihakimi
PlatformRepresents the platform from which the bot user is interacting with the bot
Profile ImageRepresents the profile image of the bot user
RegionRepresents the  region of the bot user
SSO UrlThis contains the SSO Url
Sub Flow NsRepresents the NS value of the subflow in which the bot user is currently in
TimezoneRepresents the timezone of the user
User IdRepresents the User ID assigned by the system of the bot user
User NameRepresents the username of the bot user
User NsRepresents the unique value assigned by ihakimi to every bot user

System JSON Fields Conditions

ConditionExplanation
CARTRepresents the line items user has selected when using ihakimi native ecommerce
ClaudeRepresents the chat history of the bot user when using Claude AI
DialogFlowRepresents the chat history of the bot user when using DialogFlow
GeminiRepresents the chat history of the bot user when using Gemini
Last ErrorRepresents the Last error triggered by the bot user
Last MessageRepresents the last message the bot user went through
ORDERRepresents the order placed by the bot user when using ihakimi native ecommerce
OpenAIRepresents the chat history of the bot user when using OpenAI
SELECTUnique JSON that saves the key-value pair from the JSON the user has selected from the previous step. Is used widely in For Each option.
SHOPContains the information regarding the user’s business
UserContains the complete information regarding the bot user

Miscellaneous Conditions

ConditionExplanation
SegmentsRepresents the segment the bot user belongs to
TagRepresents if the bot user has a certain tag or not
LabelRepresents if the bot user has a certain label or not
Sequence SubscriptionRepresents if the bot user is subscribed to a sequence or not
Closing NotesRepresents the closing notes assigned to the bot user
BoardRepresents the board the bot user currently is assigned to
Notification TopicRepresents the notification topic assigned to the bot user
Assigned AgentRepresents whether a certain agent assigned to the bot user
ChannelRepresents the channel the bot user belongs to
Conversation StatusRepresents the status of the bot user’s conversation (Done, Open, Pending etc)
Custom InputAllows the user to input custom inputs that doesnt necessarily fit into the various conditions provided by the user. For example using Custom JSON user fields.

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top