Nexmo Conditionals¶
Conditionals or Execution Conditions give you the power to decide if a particular action on Nexmo will be performed or not when the workflow is triggered by an incoming event. This is similar to applying "if-then-else" logic to the execution of an action based on the attribute value coming from the workflow's trigger event.
You can add conditions to any action in your workflow.
To decide which actions should be performed in response to a particular trigger based on its characteristics or the data attributes. you can even apply a complex logic using AND, OR, and grouping of such conditions.
Each of the Conditionals support different operators based on the passed data type like string, number, boolean, etc. Read here to learn more about Execution Conditions.
Example Scenario¶
To better show how Conditional Processing works, we will take a scenario where you are using Nexmo Virtual Number as a help phone number in a simple helpdesk flow. A customer can text their help requests to your Nexmo number when they need help.
Once a help request has been received, an action of creating a Microsoft Dynamics 365 task will only be performed if the message body contains certain phrases like.
When using Nexmo as the trigger application, the following attributes will be available to you in all your application actions:
Attribute | Description |
---|---|
MessageId | Nexmo's unique identifier for this message |
From | The phone number that message was sent from. In this example this would the customer's own phone number |
Type | Type of message e.g. text - standard text, unicode - a text message that contains Unicode characters, binary - a binary message. |
Keyword | The first word in the message body. If you are using a short code, this will typically be used. Find more information on short codes here. |
MessageTime | The time when message was sent to Nexmo's Virtual Number, the message time will follow the format YYYY-MM-DD HH:MM:SS |
In the case of creating a task in Microsoft Dynamics, the action is triggered when the new SMS received from the Nexmo application has Help and Lost Account in the message body. Refer Figure 1 below.
For the Nexmo SMS text response, the action will only be performed when the SMS message body contains the word Help. Refer Figure 2 below: