Check for conditions to proceed
This trigger allows to have custom conditions to be checked before rest of the triggers can be processed.
One of the few possible scenarios can be
- Collecting multiple fields before next trigger can be executed
- Comparing user message with internal chat variable. E.g you set chat variable and later you want that visitor entered correct text.
- https://www.youtube.com/watch?v=6pYWAqDrqts how to use this element in a start chat form.
- https://youtu.be/AL7RVRcvOas how to use this element and show custom content if there is no operators available.

Attribute supported placeholders
Attribute supports these placeholders
lhc.<main chat attribute>E.glhc.email,lhc.nick,lhc.phoneetc. See swagger for all attributes.<identifier>- this can be either custom attributeField identifieror just array key fromchat_variables<chat_variable>- identical to{args.chat.chat_variables_array.<variable_key>}It can be set usingUpdate current chat responseresponse type
So if you set variablebot_touchedin attribute field you can use eitherbot_touchedor{args.chat.chat_variables_array.bot_touched}{args.chat.<main chat attr>}or{args.msg.msg}you can use text matching for visitor message.online_departmentuse as attribute to check is department online (respects department online hours and operators online statuses). In value field 1 means online, 0 - means offlineonline_department__<dep_id_1>,<dep_id_2>- You can check other department online status by following example. E.gonline_department__5it would check department with id 5 online status.
online_op_departmentuse as attribute to check is department online (ignores department online hours) and checks only for operators. In value field 1 means online, 0 - means offlineonline_op_department__<dep_id_1>,<dep_id_2>- You can check other department online status by following example. E.gonline_op_department__5it would check department with id 5 online status.
online_department_hoursuse as attribute to check is department online by online hours settings (ignores ignores operators statuses). In value field 1 means online, 0 - means offlineonline_department_hours__<dep_id_1>,<dep_id_2>- You can check other department online status by following example. E.gonline_department_hours__5it would check department with id 5 online status.
siteaccessyou can use this attribute to check whatsiteaccessvisitor is on and execute appropriate trigger. E.g if you want different response by language.eng,litlist of default siteacesschat_filescheck does chat has fileschat_files>0- chat has fileschat_filescontainspdf,jpg- chat has pdf or jpg
operator_filessame checks aschat_filesexcept only for operator filesuser_filessame checks aschat_filesexcept only for visitor files{validation_event__<event_name>}E.g{validation_event__my_event_validator}event withmy_event_validatorwill be dispatched and result afterwards compared with expected output.my_event_validator=1{{args.chat.online_user.previous_chat.id}} > 0and use that condition to check did visitor had chat before with you.{args.msg.msg}OR{args.chat.last_message}check against last visitor message.media_typeyou can check this way was uploaded file or not. In right part just enter extensionsjpg,png,jpeg,gifand as a comparison variable chooseIn list, items separated by ||custom_scheduleE.g2,12:30-13:00;1,12:30-14:00it will be valid on Monday and Tuesday within specific time ranges. You can use with=and!=comparable operators. E.gcustom_schedule = 1(Schedule matches) orcustom_schedule != 1(Schedule does not match). More examples:
1-5,11:00-20:00 - Monday to Friday, 11:00 to 20:00
6-7,11:00-19:00 - Saturday to Sunday, 11:00 to 19:00
1,10:00-18:00 - Monday only, 10:00 to 18:00
7,09:00-17:00 - Sunday only, 09:00 to 17:00
If you do not enter Value means it's empty.
E.g
- so
lhc.email != <empty>as in screenshot. Means I'm checking that e-mail would not be an empty string. {args.msg.msg}I'm expecting message to contain one of the wordsdispute, chargeback, refund{2}, money back, contact bank.Refundword can have two typos.
How to validate {validation_event__<event_name>}
class erLhcoreClassExtensionValidateevent
{
public $configData = false;
public function __construct()
{
}
public function run()
{
$dispatcher = erLhcoreClassChatEventDispatcher::getInstance();
$dispatcher->listen('chat.genericbot_event_handler', 'erLhcoreClassExtensionValidateevent::genericEventHandler');
}
public static function genericEventHandler($params)
{
if ($params['render'] == 'my_event_validator') {
return array(
'status' => erLhcoreClassChatEventDispatcher::STOP_WORKFLOW,
'validation_result' => 1
);
}
}
}
Value supported placeholders
Value supports only {args. type placeholders. E.g {args.msg.msg} or {args.chat.chat_variables_array.<variable>}
How do I check visitor message with internally stored chat variable?
Example condition can look like

How do I execute triggers based on visitor priority
Let say we want to transfer players with player class VIP to operator and others keep with a bot.
We have defined custom chat variables
if (typeof lhc_var === 'undefined') { // This variable has to be defined before Live Helper Chat embed script.
window.lhc_var = {}; // Window is required to define variable in global scope
};
lhc_var.playerClass = 'VIP';
Next we have default trigger with this check

It means if player is VIP class trigger VIP will be executed, if not NonVIP trigger will be executed.
Collect all information and write information was collected.
Main trigger can look like this.

And each collecting information step can look like this

Allow to execute rest of the triggers only if e-mail is not empty
In this example we forward to e-mail collecting workflow if visitor e-mail is empty.

How to add custom icon if visitor writes some message containing specific text?
For that we will need
- Webhooks
- Trigger setup
Trigger setup can look like
![]()
Webhook setup can look like

How to execute bottom triggers if conditions is matched
There is two scenarios
If you are using If conditions are met execute this trigger
{args.chat.dep_id} = 31We want to execute only if department id is31.- check
If conditions are matched continue executing responses.This is required if you are usingIf conditions are met execute this trigger

If you are not using If conditions are met execute this trigger
- Condition changes to
{args.chat.dep_id} != 31We want to execute only if department id is31. This time it's reverse

How do I check if I had a chat with this user and skip bot in that scenario?
We will have three triggers
DefaultRemember VIPwill be triggered onrememberkeywordWelcome back VIPwill send a message if we had a chat with this visitor before.
Default trigger content
Conditions content
{args.chat.online_user.previous_chat.chat_variables_array.vip} = 1
Remember VIP trigger content
Trigger is triggered on remember keyword