Skip to main content

Variables

Do you want to collect data from customers? Do you want to specify that BPMN process modules will be entered only when certain messages have been chosen in a questionnaire? You can do that with variables!

To achieve this, you can store data entered by customers in BPMN process variables. Process variables can be created by most process modules and are either created by process modules automatically or as specified by you in the process module configuration.

Examples

In the following examples we collect data with the process modules questionnaire and variable. We are going to start with the questionnaire.

Variable from Questionnaire Module

Let´s work with the following example: During the chat, the consumer will be asked whether he likes jogging or riding a bicycle. A message should then be sent with tips for suitable clothing for the chosen hobby. If you would only drag and drop the modules, all of them would be sent. Instead, use variables to only have the right message sent. With variables, you can set what happens if the consumer clicks on one of those hobby messages.

Result

To do so, first, click on the settings icon.

Settings

Afterward, choose a process variable. A meaningful name is suitable here. Our example is about hobbies. That is why the name "hobby" is appropriate.

Choose process variable

Then you click on the settings icons for both answer options too.

Set fixed value

Here we set a fixed value and not a process variable. Because of transparency, we choose “jogging” and “bicycle”.

Set fixed value Set fixed value

Those names can be selected freely.

Variable from Variable Module

At the beginning of this article, we mentioned that variables can be set with two modules. Now you know how it works with the questionnaire. Next, you learn how to use the module “variable”. It is not that different from the questionnaire. For example, there are different combinations in which the consumer will be asked if he wants to sign up for the newsletter. So that he is not annoyed, we add a variable to save the answer. Therefore you need a variable.

Variable module

In case you have a decision jump that is asking for signing up, there are the options “yes” and “no”. Both will jump to a module “variable” (two different).

Variable module Variable module

The first module is for “yes” and the second one for “no”. We need an automatic jump because else the second module “variable” will be sent too and the chatbot will save both variables. The brick jumps to the newsletter sign up.

Condition at automatic jump

Then you fill in the fields. It is similar to the questionnaire. We need a process variable and a fixed value. Under the first arrow, you fill in a name for the process variable (for example newsletter). Under the second arrow, you choose a fixed value and add a name. It is advisable to use “newsletter” as the process variable and “yes” (or “no” for the other module).

Set variables Set variables

Afterwards, condition every newsletter module and question, if the consumer wants to sign up, with the variable you set in when the consumer says “yes”.

Set variables

You can use variables in many different cases. We made up a few examples to show you how it works!

Variable in Conditions

Now we have chosen our variables. As a next step, you choose modules that will be sent after the consumer's decision. The following step works with every module, we are using the module product overview. At each module, there is a small circle in the right corner.

Set a condition at the modules

Click on it. Afterward, choose “add condition” and fill in the three fields. For this, you need to remember the given names in the questionnaire.

Set a condition at the modules

For the first field choose “process variable”. Fill in the given name for the question. In our example, it was a “hobby”.

Set a condition at the modules Set a condition at the modules

When setting a variable it is important to pay attention to spelling. The best is, to capitalize or lowercase all initial letters. Also, avoid the space behind your variables. As soon as there is a little difference, the chatbot doesn't recognise the variables as equal. So take your time and double-check, because this can save you a lot of time later! Next, an operator must be chosen. In our case we use “is equal”.

Choose an operator

For the last field, you have to select “fixed value”.

Choose an operator

In this field, enter what was previously entered for one of the answer choices. If this module has a message for consumers who have chosen “riding bicycle” you enter in the last field “bicycle” and the other way round. The same thing you do for the second module.

Set a condition at the modules Set a condition at the modules

If you have more than two answer options you can add more modules as well. Besides, it is possible to condition more than one module for the same answer. For example, you want to give an interview and tips for the best practice to your consumer, and afterward, he can subscribe to a matching newsletter. Just drag and drop all those modules in a row and condition them with the same variable.

Besides that, one individual module can have more than one condition for when it is played. To do this, you add another condition.

Add another condition

Here you can choose whether both conditions must be fulfilled (and) or only one of the two (or).

Choose the operator

For example, if there were another answer option where the jogging tips should also be played, you would choose "or".

Two conditions

If we add a second question instead, where the user has to click on a certain answer for the module to be played, “and” would be suitable. For example, after the consumer has selected "riding a bicycle", he is also asked whether he wants to ride an ergometer or ride in the fresh air. For the rider in the fresh air, there is a product recommendation for sunscreen, and for the rider at home, a recommendation for different series to watch on the bike. Here, too, any number of conditions can be added.

As soon as more than one condition is necessary, however, you should consider whether a decision table is easier to handle. For more information, please read our article.

Process-Independent Variables

Many LoyJoy process modules automatically create process-independent variables, when customers interact with the chat. For example such process-independent variables can be the first name a customer has entered in the chat. Process-independent means, that the variable is available in the current process, and all other processes. This makes sense for variables regarding the customer, e.g. for the first name or postal address.

The following list covers most process-independent variables, which are created by process modules. Please note that:

  • The variable names do not form a forever constant API, as they may be extended and changed with the further development and growing feature set of LoyJoy. So you can use these variables, however they belong to their corresponding process module and might change occasionally, if the process module is further developed.
  • Additional variable names may and certainly will be created that are not included in this list, as many process modules such as the Variable process module and Questionnaire process module can create arbitrary variables as decided by the modeller.
Variable nameVariable description
auth_emailThe customer email address, verified in an authentication step. (Sign-In, Auth0, ReachFive, ProCampaign, Beiersdorf)
birthdateThe customer birthdate. (Birthdate)
consent_double_opt_in_newslettertrue if a newsletter double opt-in has been given. (Newsletter Opt-In)
consent_double_opt_in_profilingtrue if a profiling double opt-in has been given. (Profiling Opt-In)
consent_double_opt_in_remindertrue if a reminder double opt-in has been given. (Reminder Opt-In)
consent_double_opt_in_smstrue if a SMS double opt-in has been given via TAN code. (SMS Opt-In)
consent_single_opt_in_newslettertrue if a newsletter single opt-in has been given. (Newsletter Opt-In)
consent_single_opt_in_profilingtrue if a profiling single opt-in has been given. (Profiling Opt-In)
consent_single_opt_in_remindertrue if a reminder single opt-in has been given. (Reminder Opt-In)
consent_single_opt_in_smstrue if a SMS single opt-in has been given. (SMS Opt-In)
consent_single_opt_in_web_pushtrue if a Web push single opt-in has been given. (Web Push Opt-In)
countryThe customer country. (Postal Address)
emailThe customer email, not verified in an authentication step. (Email)
firstnameThe customer first name. (First Name, Postal Address)
house_numberThe customer house number. (Postal Address)
genderThe customer gender. Values can be male, female or diverse. These values are not exhaustive as additional values might occur depending on the process configuration. (Gender)
language_iso_6391The customer ISO 6391 language code.
lastnameThe customer last name. (Last Name, Postal Address)
localityThe customer locality, e.g. city. (Postal Address)
loyalty_balanceThe customer loyalty balance, if the customer has received loyalty points. (Code, Coupon Code, Loyalty, Loyalty Referral, Redemptions, Rewards, Win)
participation_numThe number of participations a customer has made in all processes. (Participation)
phoneThe customer phone numer. Can be any format, however should be according to E.164. (Phone)
region_iso_31662The customer region according to ISO 31662.
salutationThe customer salutation or honorific prefix, e.g. Mr. or Ms.. (Postal Address)
sign_up_ip_addressThe customer sign-up IP address. (Sign-In)
sign_up_referrerThe customer sign-up referrer. (Sign-In)
sign_up_timestampThe customer sign-up timestamp. (Sign-In)
sign_up_user_agentThe customer sign-up user agent, i.e. web browser. (Sign-In)
streetThe customer street address, optionally including the house number. (Postal Address)
tagsAn array of tags that has been assigned to the customer. (Tag)
zipcodeThe customer zip code. (Postal Address)

Process-Specific Variables

Many LoyJoy process modules automatically create process-specific variables, when customers interact with the chat. For example such variables can be a coupon code a customer has received in the chat. Process-specific means, that the variable is only available in the current process, i.e. scoped to the current process. So the variable will not be visible in other processes. This makes sense for variables that are only relevant to the current process such as a coupon code received, but not the first name of the customer.

The following list covers most process-specific variables, which are created by process modules. Please note that:

  • The variable names do not form a forever constant API, as they may be extended and changed with the further development and growing feature set of LoyJoy. So you can use these variables, however they belong to their corresponding process module and might change occasionally, if the process module is further developed.
  • Additional variable names may and certainly will be created that are not included in this list, as many process modules such as the Variable process module and Questionnaire process module can create arbitrary variables as decided by the modeller.
Variable nameVariable description
api_client_status_codeThe HTTP status code returned by API client. (API Client)
appointment_atThe appointment UTC date time. (Appointment)
appointment_dateThe appointment local date. (Appointment)
appointment_timeThe appointment local time. (Appointment)
codeA code entered by the customer. (Code)
code_inA code that should be checked. (Code)
code_valueA variable value, that is set upon entering a correct code. (Code)
consent_termstrue if the customer has accepted terms.
coupon_codeCoupon code as received by the customer. (Coupon)
interactedtrue if the customer has interacted with the process, i.e. has responded to the chat at least once.
live_in_force_startIf true, the live chat is forced to start, i.e. ignores if there are agents available. (Live, Sikom)
loyalty_points_receivedWhen the customer receives loyalty points, the number of received points. Not identical to the final loyalty_balance. (Loyalty)
loyalty_points_spentWhen the customer spends loyalty points, the number of points spent. Not identical to the final loyalty_balance. (Redemptions)
nps_detractor_textThe NPS detractor feedback text a customer has given. (NPS Survey)
nps_passive_textThe NPS passive feedback text a customer has given. (NPS Survey)
nps_promoter_textThe NPS promoter feedback text a customer has given. (NPS Survey)
nps_scoreThe NPS score a customer has given. Should be a value from 0 to 10. (NPS Survey)
nps_textThe NPS text a customer has given, either detractor, passive or promoter. (NPS Survey)
opening_hours_opentrue if opening hours are open, else false. (Opening Hours)
participationThe timestamp of the last participation, when the customer has participated in a giveaway participation. (Participation)
participation_not_allowedtrue if the customer was not allowed to participate in a giveaway participation, e.g. due to a prior participation. (Participation)
regionThe region selected by the customer. (Region)
scanner_codeThe code scanned by the customer. (Scanner)
sikom_agent_availabletrue if an agent is available in Sikom. (Sikom)
snapshot_imageThe id for the image uploaded by the customer. (Snapshot)
snapshot_image_urlThe URL for the image uploaded by the customer. (Snapshot)
talkevent_agent_availabletrue if an agent is available in Talkevent. (Talkevent)
wintrue is the customer has won an instant win, else false. (Win)