Device Magic users now have the option to set rules that enable when a Destination is active based on data collected in their forms. Basically, you can think of a Destination containing a rule(s) as being dormant until its conditions have been met. Previously, data submitted couldn't enable a Destination, it could only have an effect on the format in which the information was delivered.
An example of how Destination Rules can be useful are for users completing site inspections. Let's say an item didn't pass inspection and a manager needed to be alerted. You could setup a Destination Rule to send a copy of the submission data to a manager only when necessary. For example, if a form was completed and the question "Pass Inspection?" equalled "No", the submission data would then be sent to the manager. If "Pass Inspection?" equalled "Yes", the data would not be sent to the manager, instead following the standard Destination the user has setup.
Another example of how Destination Rules can be used is when a customer purchases an item from you. If the customer provides you with an email address in an answer within your form, the Destination Rule would send a customized invoice to that email address. If they did not provide an email address, the invoice would not be sent.
The great thing about Destination rules is that they're completely customizable to your use case!
In this article, we'll give an overview of the feature using a few simple examples. If you're not familiar with setting up Destinations for your data, please have a look at this article first since we'll just be covering the rules aspect of Destinations. Let's get started!
After creating a new or editing an existing Destination, scroll to the bottom of your edit Destination page. Destination rules will always be the last step before creating or updating your Destination.
To add a rule, click the 'Only deliver when conditions are met' button.
You're then presented with the following section.
+ Add rule - Adds an additional rule.
+ Add group - Adds a group in which you can add rules inside.
X Delete - Removes an associated rule or group.
Let's say you want to setup a simple email Destination. But, you only want this Destination to be active when certain conditions are met. This is where our new rules feature is a great fit.
To add a rule, click the dropdown on the left. You have the option to use submission metadata and form questions for your rules. 'Send a copy to' is a question within my form which I've chosen.
Then, choose the condition for the rule. There are many options, I've chose 'equal'.
Depending on the previous selection, this may be the end of the required steps to set a rule (ex. is empty, is not null,etc). In this case, you'll need to complete the final step in setting the rule's condition. Since this is a select question, the forms options are listed for me to choose from.
After selecting the final part of the rule, you'll have the option to add an additional rule or group.
If you need to add additional rules, just click the '+ Add rule' button and follow the steps above for all that are required. In some cases, a group of rules are going to be required for a Destination to be activated and that is where the 'AND' condition is needed. We've added an additional rule below as an example of two required rules.
You can interpret this rule as the answer to question 'Send a copy to' must be equal to 'Tom' and the answer to question 'Activities' must contain 'Hiking'. Please note, 'contains' is different from 'equal' in this case because the text 'Hiking' can be apart of a larger answer.
In the case that not all rules are required to be met for the Destination to deliver a submission, the 'OR' condition is fitting. Please see an example below:
This rule states that if the answer to 'Send a copy to' is equal to 'Tom' or 'David', the Destination will deliver the submission data. Just one of the conditions need to be met for the Destination.
Adding groups are useful when both 'AND' and 'OR' conditions are needed for your Destination configuration. By default, any rules that you add will be inside of an initial group. If another group is required, click the '+ Add group' button.
After adding the additional group, add any rules. Please see the circled conditions.
This Destination will be enabled if the answer to 'Send a copy to' is equal to 'Tom' and the answer to 'Rate your trip' is not empty and the group 'Rate your trip' is not equal to '1/5' or '2/5'. Only one condition in the last group needs to be met along with the first two conditions.
Also, if you ever need to bulk remove any Destination conditions, click the 'Remove Destination conditions' button. After you've set all the Destination conditions, don't forget to click the 'Create' or 'Update' Destination button below the Destinations rules section.
This concludes our overview of our Destination Rules feature. If you have any questions or comments feel free to send us a message at firstname.lastname@example.org or leave us a comment below.