Condition rules
Condition rules determine the conversation flow before and after processing dialogs.
-
Pre condition rules are evaluated before sending dialogs.
-
Post condition rules are evaluated after a response to dialogs.
Condition rules are sets of one or more conditions that each determine if the rule is met, and if so then take an action like skip (not send) the dialog, reply to the respondent, or to navigate to some other dialog or conversation.
Create and edit rules on the rule editor.
-
Click Add condition to open the rule editor.
-
A dialog can have one or more rules, each defining mappings to different valid options. When there are multiple rules, click on the rule in the editor to select the one to edit.
-
Delete a rule from the editor by clicking the X in the upper-right corner of the rule. The X only appears when you move the mouse pointer over the corner.
Rules
A rule is an action to take when either any or all of its conditions are met.
Rule conditions are sets of one or more of a
A field comparison (to some known value).
A customer reply (compared to some know value).
Sentiment (the reply is either positive, negative, or neutral). Applies to Post Conditions only. See Sentiment for complete information about this option.
When a rule has multiple conditions, they either all have to be true (AND) or any one can be true for the mapping to occur (OR).
-
All uses a logical AND to join the conditions: map only when every condition must be true
-
Any uses a logical OR to join the conditions: map when any of the conditions is true
Choose the joining-operator when you define the rule and it will automatically be applied to all conditions.
For example, this rule has two conditions, and if either is true the dialog is skipped:
when Loyalty Member = "yes" or Employee = "yes" then Skip this dialog
Conditions based on fields
Field-based conditions compare a field to a known value. In this example, the field named Loyalty Member is compared to the value "yes".
when Loyalty Member = "yes" then Skip this dialog
A field is either
Part of the invitation passed to Medallia Conversations from Medallia Experience Cloud as part of the Omni Exporter for Conversations setup.
The answer to a previously asked question (in the same conversation).
Question fields are useful for showing or hiding dialogs based on the respondent's earlier response. For example, when a respondent provides a low satisfaction-score, a dialog might ask of they want to be connected to a support agent.
Every condition is a comparison of a field and the possible value(s). How the field and values compare depends on the operator. See Rule operators (below) for detailed descriptions and examples of the operators.
Creating a rule based on a field
Every rule has at least one condition that must be true for the entire rule to be true. This example creates this simple rule based on a field that has some known information about the respondent:
when Loyalty Member = "yes" then Skip this dialog
To create this rule:
-
In the dialog editor, click Add condition.
-
Click Add rule to define a new rule and then select Use Field.
-
Define the condition. Each condition has a field, operator, and value(s).
-
Click the field position to open the field selector and choose the Loyalty Member field.
-
Each condition has an operator that determines how the response compares to the text values(s) in the condition. See Rule operators for descriptions and examples of the operators.
-
Provide the text value(s) that matches the field values.
A rule may have more than one condition. See Rule operators for details about defining them and how they are processed.
-
-
Click Select Action and choose the action to take. See Condition rule actions, below, for descriptions of the actions.
-
Click Update Dialog to save the rules to the dialog.
-
Click Save to save the conversation.
Condition rule actions
Condition actions are the activity to take when a rule is met.
- Go to Conversation
- Leave the current conversation and start the selected conversation.
Navigation flow switches to the target conversation. When that conversation completes — without first jumping to yet another conversation — the respondent interaction ends. To return to the initial conversation when finished, turn on Resume Dialog.
- Go to Dialog
- Immediately go to the selected dialog. For a pre-condition, this skips the current dialog.
- Acknowledgement (Post condition only)
- Sends a text message to the respondent. This is useful for acknowledging the respondent's response, like "Got it, thanks."
- Skip this dialog (Pre-condition only)
- Skip this dialog and go immediately to the next dialog in the conversation.
Rule operators
A rules operator determines how the response compares to the alternative text in the condition.
| Operator | Match when the response … | Example | The value |
|---|---|---|---|
| equal to (=) | … exactly matches the text | e_firstname = "Nancy" | … is "Nancy" … |
| distinct to (!=) | … does not match the text | e_firstname != "Nancy" | … is anything, even no value, except ''Nancy" |
| in | … matches one of the words in the text | message in {"Nancy,Mike,Skyler"} | … is one of the three names. |
| not in | … does not match any word in the text | message not in {"Nancy,Mike,Skyler"} | … is anything except one of the three names. |
| match (=~) | … contains text matching a regex pattern | message =~ /(?:)Orion/i | … contains "orion" (case insensitive) is somewhere in the message |
Regex (match) operations
The match operator uses regex patterns to identify text in the field value.
When defining a match operation for a dialog, there are two fields: the top one is the pattern to match, and the bottom one is for any global flags. See the next example for an illustration.
The most common match operation is to identify when a word or string in anywhere in the response. To match when the response contains "Orion" case insensitive, use this pattern and flag. (Compare this illustration with the one above for regex101 to see an explanation for the pattern and flag.)
Regex patterns can do complex matching. For example, to verify the user provided an 12-digit number like "123412341234:
/\d{12}/gIf the user is providing a number that may contain separators like dashes, periods, spaces, or no separator, you might use this pattern:
/\d{4}([- \.]?)\d{4}([- \.]?)\d{4}/gThe above matches all of these numbers:
My account number is 6501-5555 0112. Please send me my password.
My number is 1234 1234 1234.
123412431234
And 1234.1243.1234 Regex patterns are very powerful, but be sure to test them thoroughly before putting them into production. It is very easy to match text you did not expect. For example, if you are looking for the word "fast", you can get a match for "breakfast".
