Connect custom attributes and reports with workflows
Last Update: Oct 2024 • Est. Read Time: 3 MINKustomer comes pre-loaded with standard objects and attributes which are used in reporting and filtering data. However, most businesses need to add custom data from external sources in order to report on metrics more unique to their business.
You can use workflows and custom attributes to move data from one area of Kustomer to another in order to use specific metrics wherever they're needed. In this tutorial, you'll learn how to set up a workflow that brings in custom attribute data, and then build a custom report around this data.
Who can access this feature? | |
User types | Admins can access workflows, attribute settings, and reporting. |
In this article
- Prerequisites
- Create the custom attribute
- Create the workflow
- Customize the workflow
- Create the custom report
Prerequisites
Before following this guide, you should already be comfortable with the basics of using workflows. Workflows overview
We also recommend being familiar with Custom attributes and Custom reporting.
Create the custom attribute
First, you'll create the attribute on the desired Klass. For the purposes of this tutorial, the attribute will be created on the Message Klass to track the queue the conversation was in when a message was sent.
- Go to Settings > Platform > Klasses.
- Select the Klass you want the attribute to be on. If you're following the tutorial example, select the Message Klass.
- Select Create Attribute.
- Create a new attribute with the following properties:
- Name: Queue
- Type: Single line text
- Single Value
Create the workflow
Next, you'll create a workflow that will trigger when a new message is created which adds the conversation's queue at that time to the message object.
- Go to Settings > Platform > Workflows.
- Select Add Workflow > Custom Workflow.
- Fill in a name and description for your workflow. If you're following the tutorial example, name it Add Message Queue. As a best practice, we always recommend using clear, descriptive titles to help you and the rest of your admin team remember how this automation will be used in the future.
- Leave the callable workflow option turned off.
- Select Create to save the workflow. You'll be taken to the Workflow Editor where the workflow can be customized.
Customize the workflow
- Select the first step. In the right panel, set the trigger to:
- Trigger App: Kustomer
- Trigger Event: Message Created
- Add an action step to look up the conversation from step 1.
- Action App: Kustomer
- Action Event: Conversation: Lookup (By ID)
- Id (string): /
#steps.1.conversation
Next, set up any condition steps as desired to filter out certain types of messages. If you're following the tutorial example, you'd set up a condition that continues only if a conversation has a queue assigned.
- Next, add an action step to update the message by adding the conversation's queue as the message queue. This updates custom attribute on the message Klass, using the queue from the Conversation: Lookup (By ID) step.
- Action App: Kustomer
- Action Event: Message: Update
- Id (string): (1) Message Created > Id, or
/#steps.1.id
- Queue (string): (2) Conversation: Lookup (By ID) > Queue
Note: If you don’t see a field for Queue (string) or your custom attribute at this step, make sure you've created the custom attribute on the Message Klass.
When you're finished with the workflow, Save it. After turning on this workflow, messages should now have a queue attribute saved to them, as long as the queue has been set on the conversation.
Create the custom report
Finally, you'll set up a custom report that incorporates your new custom attributes.
To create a custom report:
- Go to Reporting.
- From the sidebar, either create a new report, or select an existing custom report and select Add Chart from the toolbar.
- In the Chart Editor, select Start From Blank. Then, build your data with the following suggested properties:
- For the Data Object Type, select Message.
- For the Date Attribute, select Created At. This will show the total number of messages created during the selected time range, as long as there aren't any conditions or segmentation.
- For the Chart Type, we recommend selecting Table. This will show a simple view of the messages in each queue.
- Select Segment By: Queue to see how many messages were sent for each queue.
- Finish by adding any filter operators as desired. This would be a useful way to hone in your report to make it more relevant to the data you care about, by filtering out spam or only showing outbound messages.
- Select Next to finish your chart by customizing the title, description, axis label, and time interval as desired.
- When you're finished, Save your chart.
You can now refer to this chart in your custom reports to see relevant data and improve your team's performance and efficiency.