A recipe has a set of Conditions that are assessed when it is triggered. If all of the conditions pass, then the recipe’s set of Actions is executed. If any of them fail then the recipe’s set of Fallback Actions will be executed.
A condition is a test on a specific element such as the content of an SMS, the time or something like whether the number that sent an SMS or Missed Call is attached to a contact that is part of specific group.
What conditions can be used depends on the type of trigger that has triggered the recipe. For example, if the recipe is triggered by a Missed Call then any conditions evaluating the trigger’s message text will not be able to test it as a Missed Call does not have any text. In the same way an Absolute Time Trigger will not have any sender number or contact details associated with it that could be tested.
MessageTextStartsWithRule
{
"type": "MessageTextStartsWithRule",
"data": {
"prefixText": "Alert"
}
},
Description A condition that checks whether the trigger’s message (an SMS) text begins with a certain set of words. This will evaluate as true if and only if all the words stated are matched in the order they are entered.
Matching is case insensitive.
Links
Parameters Any String value.
MessageTextContainsRule
{
"type": "MessageTextContainsRule",
"data": {
"messageContainsText": "emergency situation"
}
},
Description A condition that checks whether the trigger’s message (an SMS) text contains a certain set of words. This will evaluate as true if and only if all the words stated are matched in the order they are entered. If the order does not matter, but simply presence somewhere of the words, then use a separate instance of this condition for each word.
Matching is case insensitive.
Links
Parameters Any String value.
NumberStartsWithRule
{
"type": "NumberStartsWithRule",
"data": {
"prefixText": "+254"
}
}
Description A condition that checks whether the trigger’s SMS or Missed Call number begins with a certain number. This will evaluate as true if and only if all the numbers stated are matched in the order they are entered.
Links
Parameters Any String value.
NumberContainsRule
{
"type": "NumberContainsRule",
"data": {
"numberContainsText": "555"
}
}
Description A condition that checks whether the trigger’s SMS or Missed Call number contains a certain number. This will evaluate as true if and only if all the numbers stated are matched in the order they are entered. If the order does not matter, but simply presence somewhere of the numbers, then use a separate instance of this condition for each number.
Links
Parameters Any String value.
MessageTextReceivedWithinPeriodRule
{
"type": "MessageTextReceivedWithinPeriodRule",
"data": {
"interactionIdentifier": "${trigger.sourceNumber}",
"timeUnits": "30",
"timeUnitType": "minutes"
}
},
Description Makes an assessment of whether an SMS message has been received from a specified number or contact within a specified time period. This is useful in checking for previous communication from a contact before acting in some way.
In the example above a check is being made to assess whether there has been an SMS received from the trigger’s SMS sender number/contact in the last 30 minutes from the time of the SMS or Missed Call just received that triggered the recipe with this condition.
Links
Parameters 3 parameters are expected:
MessageTextSentWithinPeriodRule
{
"type": "MessageTextSentWithinPeriodRule",
"data": {
"interactionIdentifier": "${trigger.sourceNumber}",
"timeUnits": "1",
"timeUnitType": "hours"
}
},
Description Makes an assessment of whether an SMS message has been sent to a specified number or contact within a specified time period. This is useful in checking for previous communication from a contact before acting in some way.
In the example above a check is being made to assess whether there has been an SMS sent to the trigger’s SMS sender number/contact in the last 1 hour from the time of the SMS or Missed Call just received that triggered the recipe with this condition.
Links
Parameters 3 parameters are expected:
MissedCallReceivedWithinPeriodRule
{
"type": "MissedCallReceivedWithinPeriodRule",
"data": {
"interactionIdentifier": "${trigger.sourceNumber}",
"timeUnits": "2",
"timeUnitType": "days"
}
},
Description Makes an assessment of whether an Missed Call has been received from a specified number or contact within a specified time period. This is useful in checking for previous communication from a contact before acting in some way.
In the example above a check is being made to assess whether there has been Missed Call received from the trigger’s SMS sender number/contact in the last 30 minutes from the time of the SMS or Missed Call just received that triggered the recipe with this condition.
Links
Parameters 3 parameters are expected:
ContactKnownRule
{
"type": "ContactKnownRule"
}
Description Performs a check on the trigger’s SMS or Missed Call number. Returns true if the number is associated with a contact in the contact database.
Links
Parameters None
ContactMemberOfGroupRule
{
"type": "ContactMemberOfGroupRule",
"data": {
"groupName": "Friends"
}
},
Description Performs a check on the trigger’s SMS or Missed Call number. Returns true if the number is associated with a contact that is a member of the specified Group.
Links
Parameters Only the name of the group is required:
ReceivedThroughRule
// Missed Call or SMS example
{
"type": "ReceivedThroughRule",
"data": {
"connectionName": "Alex's Android"
}
},
// API Request example
{
"type": "ReceivedThroughRule",
"data": {
"apiKeyName": "Alex's Android"
}
},
Description Performs a check on the trigger’s SMS, Missed Call or API Request Connection. If the trigger is a Missed Call or SMS, returns true if the Connection that the interaction was received on matches the specified connection name. If the trigger is an API Request, it instead checks if the trigger was sent using the specified API key.
Links
Parameters Only the name of the group is required:
CustomFieldBooleanRule
{
"type": "CustomFieldBooleanRule",
"data": {
"customFieldName": "Trusted source",
"valueToCompare": true
}
},
Description Performs a check on a Contact’s boolean field value. A boolean field can either be True or False. The conditions returns true if the state of the field matches that of the specified value.
This example checks whether or not the field labelled ‘Trusted source’ is currently True; in other words is the contact a trusted source.
Links
Parameters 2 parameters are expected:
CustomFieldNumericRule
{
"type": "CustomFieldNumericRule",
"data": {
"customFieldName": "Leave days remaining",
"stringToCompare": "10",
"operator": "LESS_THAN"
}
},
Description Performs a check on a Contact’s integer (numerical) field value. The conditions returns true if the state of the field matches that of the specified value with the specified operator.
This example checks whether or not the field labelled ‘Leave days remaining’ is currently less than 10; in other words does the contact have fewer than 10 days of leave left.
Links
Parameters 3 parameters are expected:
ContactFieldEqualsRule
{
"type": "ContactFieldEqualsRule",
"data": {
"customFieldName": "Favourite football team",
"valueToCompare": "Tottenham"
}
}
Description Performs a check on a Contact’s string (text) field value. The conditions returns true if the contents of the field matches that of the specified string value.
This example checks whether or not the field labelled ‘Favourite football team’ is ‘Tottenham’; in other words does the contact support Tottenham.
Links
Parameters 2 parameters are expected:
FlangExpressionRule
{
"type": "FlangExpressionRule",
"data": {
"expression": "${trigger.sendSmsPayload.message.startsWith(\\\'spam\\\')},
"description": "Checks if the message content starts with \\\'spam\\\'"
}
}
0 Comments