Omnichannel

Security and Compliance

Splitting the Workflow Depending on the Event Parameters

The Condition block allows you to split the workflow depending on the parameters of the event that launched the workflow. These can be the following parameters:

  • Category of the site visited by the contact
  • City of residence
  • Clothing size
  • Product preferences
  • Gender

For example, you need to send emails with selections of products for men and women, depending on gender, the value of which is passed in the event by the Generate event API method:

{
    "eventTypeKey": "event_name",
    "keyValue": "user@example.com",
    "params":
    [
        {
            "name": "EmailAddress",
            "value": "user@example.com"
        },
        {
            "name": "Name",
            "value": "John"
        },
        {
            "name": "lang",
            "value": "EN"
        },
        {
            "name": "gender",
            "value": "M"
        }
    ]
}

Workflow Settings

1. Create a workflow with two Condition blocks that check the event parameters and send the contact to the appropriate branch. An example of such a workflow:

Workflow example

2. Set up the first Condition block:

1) Select Variable matches regular expression in the Task name field to check the contents of the gender parameter.

2) Add the name of the validation parameter in the name field, in our case, it is gender.

3) Specify the value of the request parameter in the pattern field in the following format: .*M.* (male).

Block settings

Important

The case of the letter in the pattern field must match the case of the letter in the event parameters

3. Add the second Condition block to the workflow with the same settings as the first one, but with the .*F.* (female) pattern.

Block settings

If the event parameters match the value specified in the first condition,  contacts will go along the “Yes” branch; if not, they will go to the next checkpoint.

Contacts without gender specified in the request will go through the third workflow branch.

Similar articles:

Any Questions?
We’re always happy to help!
Discount services
Schedule a Call
Fill in the form, and our specialists will call you back as soon as possible.
Discount services
Chat Support
We’re waiting for your questions!
Discount services
Email
Contact the support team