Connecting to Slack
Slack receives events as readable messages in a channel rather than as raw data. Electric writes each message for you, with a bold title, a short sentence, and the relevant details underneath. Task events also include a View details link back into Electric.
Steps in Slack:
-
Log in to Slack
-
Navigate to Agents & tools and then select Open in Slack Marketplace
-
In the Slack Marketplace select Manage and then Custom integrations
-
Select Incoming webhooks
-
Click Add a configuration, or Edit an existing one
-
Choose a default channel
-
Copy the Webhook URL
Need detailed instructions? Slack documents this in Legacy custom integrations: incoming webhooks. Slack now recommends app-based incoming webhooks for new setups, and either kind of address works with Electric.
Steps in Electric:
-
Log in to Electric
-
Select Settings, then the Webhooks tab
-
Click Create webhook and select Slack
-
Enter a Name for the webhook
-
Paste the Slack webhook URL into Endpoint URL
-
Enter a Channel to override the default you chose in Slack, for example
#it-alerts, or leave it blank to use that default -
Enter a Username to control the name shown on each message, for example
Electric IT Hub, or leave it blank -
Select your topics, leave Active on, and Click Create webhook
-
You are all set!
Please note: A Slack incoming webhook posts to one channel. To send the same events to more than one channel, create a separate incoming webhook in Slack and a separate webhook in Electric for each channel.
What each Slack message looks like
Electric writes each Slack message for you, with a bold title, a short sentence, and the relevant details underneath. The table shows the message for each event, using the sample data from a test event. Your messages will show your own employee, group, and task details.
|
Event |
Message |
|---|---|
|
|
New employee: Jane Doe
|
|
|
Employee updated: Jane Doe
|
|
|
Employee offboarded: Jane Doe
|
|
|
Employee reactivated: Jane Doe
|
|
|
Jane Doe added to a group
|
|
|
Jane Doe removed from a group
|
|
|
New group: Example Group
|
|
|
Group updated: Example Group (renamed)
|
|
|
Group deleted
|
|
|
New request: Grant access to Slack
|
|
|
Request completed: Grant access to Slack
|
|
|
Request canceled: Grant access to Slack
|
|
|
Request automation failed: Grant access to Google Workspace
|
Please note: View details is a link that takes you to the task in Electric. Messages for task events use the word "request", to match the event names such as request.created.
Which lines appear
Some lines only appear when the information is available.
Employee events
-
The Job title and Email lines appear only if the employee has them.
-
If the employee has no first or last name, the message says "An employee" instead.
-
Previous lines appear only on
employee.updated, and only for fields that changed. There is one line for each changed field, such as Previous job title, Previous email, or Previous groups. A value that was cleared shows as "(none)". The sample above changes only the job title, so only one Previous line shows. -
If the group name is missing on
employee.group_addedoremployee.group_removed, the message says "an unknown group".
Group events
-
Employees always appears on
group.createdandgroup.updated, and shows 0 if the count is missing. -
Previous lines appear only on
group.updated, and only for fields that changed. The fields are name, parent group, and employee count. -
If the group name is missing, the message says "Unknown group".
-
group.deletedhas no detail lines, and the sentence shows the group's ID.
Task events
-
Requester, Requested for, and Assignee each appear only if that person exists and has a name. Their email appears in parentheses when there is one. Requested for is the person the task was raised for.
-
View details appears only if the task has an ID.
-
If a task has no title, the message uses the task type instead.