When a recipes is triggered and its conditions are passed, then the full set of that recipe’s Actions are executed. If any of the conditions fail, then all of its Fallback Actions are executed. The options for entries and types of Actions and Fallback Actions are identical; they are separated by the situations in which they are called.
An Action can affect many things with a workspace and execute outbound events such as sending messages.
A recipe can have any number and combination of Actions and Fallback Actions.
An example below of the two sets of actions and their corresponding naming. Here there are now actions except the auto-created tagging that would be created for a recipe named ‘Matched this recipe’. If an interaction passes the conditions the interaction will be tagged ‘Matched this recipe’, if not it will be tagged ‘!Matched this recipe’:
],
"actions": [
{
"type": "AddTagAction",
"data": {
"tagName": "Matched this recipe"
}
}
],
"elseActions": [
{
"type": "AddTagAction",
"data": {
"tagName": "!Matched this recipe"
}
}
]
},
AddTagAction
{
"type": "AddTagAction",
"data": {
"tagName": "Matched trusted credentials"
}
}
{
"type": "AddTagAction",
"data": {
"tagName": "fruit//apple"
}
}
{
"type": "AddTagAction",
"data": {
"tagName": "fruit/vegetable"
}
}
Description Adds a tag to the interactions that triggered the recipe, such as an SMS or a Missed Call.
The introduction of nested tags enables a builder to assign multiple tags to an AddTagAction
. Nested tags are created by separating multiple tag names with double forward slashes (//) as show above. Note that a single forward slash (/) will not create multiple tags and it will be treated as a single tag entry. Any number of tag actions are permitted and are not unique across recipes so that tag can be applied by more than one recipe.
Links
Parameters Expects one variable:
SendMessageAction
{
"type": "SendMessageAction",
"data": {
"messageText": "There is an issue in the system, please reply 'REPORT' for further info",
"connectionName": "Alex's FrontlineSync Android",
"recipients": {
"contacts": [
"+254 777 555 888"
],
"groups": [
"On call this week"
],
"smartGroups": [
"Contactable"
],
"addresses": [
"${trigger.sourceNumber}"
]
}
}
},
Description Sends a message (an SMS depending on the connection specified) through a named connection to the set of recipients defined.
In the example above a message will be sent out on the connection to ‘Alex’s FrontlineSync Android’ to a numbered contact, the groups ‘On call this week’ and ‘Contactable’ and the number associated with the trigger of the recipe. The message sent will be ‘There is an issue in the system, please reply ‘REPORT’ for further info’.
Links
Parameters Expects 3 sets:
- messageText
- connectionName
- recipients
- sendThrough
UpdateContactFieldAction
{
"type": "UpdateContactFieldAction",
"data": {
"fieldName": "name",
"fieldValue": "Alex",
"recipients": {
"contacts": [
],
"groups": [
],
"smartGroups": [
],
"addresses": [
"${trigger.sourceNumber}"
]
}
}
},
{
"type": "UpdateContactFieldAction",
"data": {
"fieldName": "addToNotes",
"fieldValue": "New session commcenced in local HQ",
"recipients": {
"contacts": [
],
"groups": [
"On call this week",
"On call supervisors"
],
"smartGroups": [
],
"addresses": [
]
}
}
},
Description Updates, sets or appends to a field on a set of contacts (1 or more).
In the above example the name field of the contact associated with the trigger’s number will be set to ‘Alex’. Then the Notes field of the contacts within the groups ‘On call this week’ and ‘On call supervisors’ will be appended with ‘New session commcenced in local HQ’.
Links
Parameters Expects 3 sets:
CustomFieldBooleanAction
{
"type": "CustomFieldBooleanAction",
"data": {
"customFieldName": "Responded",
"operation": "SET_TRUE",
"recipients": {
"contacts": [
],
"groups": [
],
"smartGroups": [
],
"addresses": [
"${trigger.sourceNumber}"
]
}
}
}
Description Sets a boolean custom field value directly to be True, False or toggle the value depending on the previous value.
In the above example the contact associated with the number of the trigger interaction will have its boolean custom field ‘Responded’ set to True.
Links
Parameters Expects 3 sets:
CustomFieldNumericAction
{
"type": "CustomFieldNumericAction",
"data": {
"customFieldName": "Number of times contacted",
"customFieldValue": "1",
"operation": "INCREMENT",
"recipients": {
"contacts": [
],
"groups": [
],
"smartGroups": [
],
"addresses": [
"${trigger.sourceNumber}"
]
}
}
}
Description Updates an integer (numeric) custom field value directly to be a certain number or affect the value by incrementing or decrementing the previous value.
In the above example the contact associated with the number of the trigger interaction will have its integer custom field ‘Number of times contacted’ incremented by 1.
Links
Parameters Expects 3 sets:
AddToGroupAction
{
"type": "AddToGroupAction",
"data": {
"groupName": "Trusted Contacts"
}
}
Description Adds the sender of the interaction (trigger) to the specified group. The sender will either be a pre-existing contact or if not an un-named contact will be automatically created with the sender’s number.
Any number of add group actions are permitted.
Links
Parameters Expects one variable:
RemoveFromGroupAction
{
"type": "RemoveFromGroupAction",
"data": {
"groupName": "On call this week"
}
}
Description Removes the sender of the interaction (trigger) from the specified group. If the sender does not exist as a pre-existing contact (i.e. the trigger number is not matched in the contact database) or the contact is not in that group, then no action is taken.
Any number of remove group actions are permitted.
Links
Parameters Expects one variable:
TriggerRecipeAction
{
"type": "TriggerRecipeAction",
"data": {
"recipeToTriggerId": 459,
"delayTimeUnit": "HOURS",
"delayLength": "1"
}
}
Description Created by the system whenever a Recipe A is set as a trigger for another Recipe B. This action is only controlled by editing the trigger end of the link.
In this example this is a view of Recipe A referring to Recipe B which has an ID of 459. The action states that B will be called by A’s action 1 hour after the action is executed.
Links
Parameters Expects 3 sets:
0 Comments