Use business rules to update custom attributes
Last Update: Sep 2024 • Est. Read Time: 2 MINA custom attribute (sometimes called a custom field) adds more detail and information to a conversation's Insights panel. You can create automations to update these automatically based on inbound messages sent to your company. Business rules make it easy to update a custom attribute based on a trigger, like a keyword on an incoming email.
This article will explain a basic business rule that sets the value of a custom attribute based on a keyword in the message's body, but you can adapt these steps to perform any other action of your choice.
Who can access this feature? | |
User types | Admins can create business rules. |
In this article
- Prerequisites
- Create the business rule
- Configure the business rule trigger and conditions
- Set actions for the business rule
Prerequisites
Before following this guide, you should set up the desired custom attributes for the Conversation Klass. For demonstration purposes in this article, we'll work with one of the most commonly-used custom attributes for a conversation: a Contact Reason attribute that uses a Single-line text Option List or Multi-level list type.
We also recommend that you already be comfortable with the basics of using business rules.
Create the Business Rule
The first step will be to create a new business rule:
- Go to Settings > Platform > Business Rules.
- Select Add Rule.
Configure the business rule trigger and conditions
This brings up a preference pane labeled Edit Business Rule where the rule can be adjusted. Next, we'll set up this rule to adjust the trigger and criteria that cause the rule to fire. In this example, we'll be creating a business rule that reviews the first inbound interaction from a customer, and if the message is sent to our org's orders@example.com
email alias, it sets the Contact Reason to Order.
To edit the business rule:
- Fill out the Name and Description of this rule. We always recommend that you use clear and illustrative names and descriptions as a best practice so that it's easy to know what function this rule performs if another member of your team reviews this rule at a later date.
- Under Set Trigger, use the menu to select what triggers the business rule. In this example, we'll use Conversation Updated: First Inbound Interaction so that the rule doesn't fire every time the customer replies.
- Use the Conditions settings to control the criteria this trigger looks out for. In this example, we'll use the Message - To - Contains - [orders] condition to filter on emails sent to our example org's order email address, which might look like orders@example.com. We'll also add a failsafe of Conversation - Contact Reason - Is Not Set that ensures this rule doesn't collide with any other business rule or workflow that might also set the contact reason.
Set actions for the business rule
The final section in the business rule settings is where you'll configure what action(s) this rule performs when activated. Our example rule will apply the Contact Reason: Order custom attribute to the inbound conversation.
To set the actions for the business rule:
- Under Set Actions, use the Select Action Type menu to choose Update Data.
- Select Add Action.
- In the Type menu, select Conversation.
- In the Field menu, select Contact Reason.
- In the Operation menu, select Replace With.
- Use the Option menu to select the custom attribute.
The finished rule can now be saved, and you can activate the business rule whenever you wish for it to take effect.