Implementing logic
Last updated
Last updated
In the previous section, you learned about the power of Modifiers and their ability to alter data in your flow. Now, we'll go through another powerful feature of Appmixer, logic.
Logic is represented mainly by the "Filters" component that you can find among Utilities. This feature allows you to set certain rules in your flow.
To see the logic in action, let's look at a simple example. Imagine you want to get notified via SMS every time someone mentions the word "Urgent" in a Slack channel. We're humans and we forget. This simple flow will make sure you receive the message when there's a fire.
You'd start building your flow by adding Slack and Twilio (or any other provider) components.
In between them, you'll want to add "Filters" and apply the "Contains" logic.
Now, it's time to set the logic. You'll want to use a Variable to check if the Slack message contains the word "Urgent".
Finally, choose the "contains" path and connect it to Twilio. After you do that, you'll be able to finalise the flow by setting the text message, "From number" and "To number". Let's say we want to use the whole Slack message as the SMS text. To do that, you'll use Variables that we explained in the previous section.
Awesome, isn't it? Keep in mind that "Contains" is just one of the logic options you can use. Here's the rest:
Contains A message passes through this filter if a value from a previous connector contains the value specified. Values can be numbers, dates or a plain text.
Equal A message passes through this filter if a field from the previous connector contains a value that equals the value specified. Values can be numbers, dates or a plain text.
Greater than A message passes through this filter if a field from the previous connector contains a value that is greater than (or equal, by default) the value specified. Values can be numbers, dates or a plain text.
IsNotEmpty A message passes through the filter if it contains data in the specified field.
LessThan A message passes through this filter if a field from the previous connector contains a value that is less than the value specified. Values can be numbers, dates or a plain text.
Modulo A message passes through the filter if the remainder after division of the value received from the previous connector by the value specified is zero.
NotEqual A message passes through this filter if a field from the previous connector contains a value that does not equal the value specified. Values can be numbers, dates or a plain text.
Range A message passes through this filter if a field from the previous connector contains a value that falls into the range specified. Values can be numbers, dates or a plain text.
Appmixer is all about flexibility and agility. You can customise all components and also implement your own using Node.js and upload them to the Appmixer engine via the API to suit your specific business needs.
You've just learned how to implement logic into your flow. In the next section, you'll find out how to view logs and troubleshoot errors.