Custom Message Formatting for Slack and Microsoft Teams Integrations
To make sure your customizable messages on our native Slack and Microsoft Teams integrations are formatted correctly, please follow the guidelines below.
- Example of message:
{entity.first_name} {entity.last_name} just closed {entity.name} for ${field[1].value}!
- This will translate into "John Doe just closed Companyxyz for $1000000000!"
There are three objects that are accessible in configuring the Slack/Microsoft Teams message:
- Entity
- Entity Associations
- Fields
Note: Go to this section "Commonly used basic formatting with markdown" to understand how to format your message with line breaks, as well as bold, italic, or strikethrough text.
Entity
This is the person/company/opportunity that's associated with the entity value. It is critical that you understand which type of entity the integration is enabled for. If you're not certain, please reach out to support@affinity.co to confirm.
Here are the valid expressions for a PERSON entity:
{entity.id}
{entity.first_name}
{entity.last_name}
{entity.primary_email}
Here are the valid expressions for a COMPANY entity:
{entity.id}
{entity.name}
{entity.domain}
- Wrapping the above with <> appended with
https://
will create a clickable link in Slack (Not available in Microsoft Teams).
Eg;<https://{entity.domain}>
or<https://{entity.domain}|{entity.name}>
or<https://{entity.domain}|Custom Text Here>
- Wrapping the above with <> appended with
Here are the valid expressions for an OPPORTUNITY entity:
{entity.id}
{entity.name}
Entity Associations
These are the people/companies associated with an entity (opportunity, company, person).
- For a people list, you can access the companies associated with that person with
{entity.organization_names}
. - For an organization list, you can access the associated people with
{entity.person_names}
. - For an opportunity list, you can access both the associated organizations and people via
{entity.organization_names}
and{entity.person_names}
.- For both of those associations, the output will be a comma separated list of the names of the organizations/persons.
- For example:
-
{entity.organization_names} => Stripe, Dropbox, Affinity
-
{entity.person_names} => Mimi Lee, Calvin Lee
-
Fields
These are the fields you can change to trigger a response or fields you would like to have populated in a message. Think of these as columns in your list.
Note: In a previous step of the configuration, you're prompted to include a list of field IDs of all the fields you would like to reference in the message. Please double-check that the field IDs are tied to the correct entity type and the correct list (if applicable).
You can reference the fields by the INDEX, in the same order as your input in the list in the previous step.
- For example, if you added
[12345, 678910]
...- You can reference the field
12345
byfield[0]
- You can reference the field
678910
byfield[1]
- You can reference the field
It's also important to double-check the field value TYPE as it changes the way you can access the actual value. See below on how to access the value of each field by type:
All fields have the following valid expressions:
{field[0].id}
{field[0].field_id}
{field[0].list_entry_id}
{field[0].entity_id}
To access the actual value of the fields based on value type:
- For text, number, date, multiline-text, or managed dropdown fields
{field[0].value}
- For person field (i.e. Owners)
{field[0].value.id}
{field[0].value.first_name}
{field[0].value.last_name}
{field[0].value.primary_email}
- For company field
{field[0].value.id}
{field[0].value.name}
{field[0].value.domain}
- For ranked dropdown field (i.e. Status)
{field[0].value.id}
{field[0].value.text}
- For location field
{field[0].value.street_address}
{field[0].value.city}
{field[0].value.state}
{field[0].value.country}
{field[0].value.continent}
Commonly used basic formatting with markdown
Visual basics
_italic_
will produce italicized text*bold*
will produce bold text~strike~
will produce strikethrough text
Line breaks
\n
will insert a new line