Skip to content

WhatsApp Conditionals

Conditional Processing or Execution Conditions give you the power to decide if a particular action on WhatsApp will be performed or not when the workflow is triggered by the incoming event. This is akin to the ability to apply 'if-then-else' logic to the execution of an action based on the value of the attribute from the trigger event of the workflow.

Think of Conditional Processing as an equivalent of 'if-then-else', as decision diamond in the flow chart, or the Conditional Branching in BPEL (Business Process Execution Language).

You can add conditional processing to any action in your workflow and decide which actions should be performed in response to a particular trigger event identified by its characteristics or the data attributes. You can apply complex logic using AND, OR, and grouping of such conditions. Each of the conditions supports different operators based on the event data types like a string, number, boolean, etc. Read here to find more about Conditional Processing.

Example Scenario

You can take a scenario where you are using WhatsApp as an intake of help requests for your business. In this scenario, you can have two actions to handle customer help, one action will create a task in Salesforce and the other action will send out a message informing the user that their request has been received. Each of the actions in the flow will apply its own execution condition based on the data attributes of the WhatsApp trigger event. This will allow each of the actions to independently choose to execute based on the defined execution conditions.

We will take a part of this example and define conditions for a Salesforce task creation action, where the action won't be performed unless the trigger event is a help request for a lost account. There could be other Salesforce actions with conditions for other types of help requests, but we will only focus on one. Using these attributes below:

  • To - Your businesses WhatsApp number, or in the case of the sandbox, the sandboxes WhatsApp number
  • From - Your customer's WhatsApp number
  • Body - The message body of the WhatsApp message

You can set up the conditions for the salesforce action using these attributes, as shown in the figure below.

Conditional Processing in Connect iPaaS

Figure 1. Conditional Processing in Connect iPaaS