MQTT Conditionals¶
Conditionals or Execution Conditions give you the power to decide if a particular action on NetSuite will be performed or not when the workflow is triggered by the 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 the actions that 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¶
We will take a scenario where you are using MQTT as the trigger application. There could be multiple application actions that could be invoked upon receiving a MQTT trigger.
Each of the actions in the flow would apply its execution condition based on the data attributes of the MQTT trigger event. This allows each of the actions to independently execute based on the defined execution conditions.
In this example, the workflow is triggered when a New Event is received on a topic configured with the IoT device.
When using MQTT as the trigger application, there is only one attribute available to you in all your application actions:
- IOT data - The data received on any topic
In Figure below, in the workflow where, a new message will be sent to a selected channel in Microsoft Teams action "Send a message to channel" only when the new event received on IoT device topic contains "robomq" .