In this article we will explain how to create a Slack message using fields from another object. There are times where you will want to send a Slack message that contains dynamic data from a related object 🤓.
📌 Important to note: this is the advanced version of how to send a Slack message using an automation. If you would like to create a basic automation that will send messages to Slack then check out this article 👍
In this example we will show you how to dynamically pull data from 3 different objects into a single Slack message. I'll start this automation off by using an "End User" filter (starting object) and we will gather data from the parent "Company" and "User" objects.
Understand and know which object is your starting object. This is the object where the automation gets triggered. In our example this will be the "End User".
Now you will need to create a new step so that you can gather all of the fields for the related object. In our example this will be for "Company" and to do that we need to add a step (see below).
Now that you have all of the data from the "Company" object, you also want to get the "Owners" name (we don't want the Owners ID). For this, create another step using the information that we gathered in step 1. We want to get data from the "User" object (see below).
This now allows you to gather information from 3 different objects:
We would like to include the co-owner of the account as well so we're going to add an additional step. Similar to step 2 except we're referencing the co-owner field (see below).
Now that you have all of the data needed from all of the related objects, you can create your Slack message and reference those fields from those objects. For example:
<<object.name>> was added to the filter and is part of <<Step 1.name>>. The owner of the company is '<<Step 2.firstName>> <<Step 2.lastName>>' and the Co Owner is '<<Step 3.firstName>> <<Step 3.lastName>>
That message translate to: "End User Name" was added to the filter and is part of "Company Name". The owner of the company is "Owner Name" and the Co Owner is "CoOwner Name"
Slack Automation Setup:
Received Slack Message: