Skip to content

Integrate Slack and Salesforce in 20 mins! πŸ’¬πŸŒ©οΈπŸŒ

Notifications You must be signed in to change notification settings

shrutis22/slack-salesforce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Integrate Slack and Salesforce in 20 mins! πŸ’¬πŸŒ©οΈπŸŒ

Presented at VirtualDreamin'20

Recording-_331

πŸ“Ί Walkthrough

  1. Slide Deck - https://docs.google.com/presentation/d/1Qsz_CFvs-1qHIRwkMjlp_7vP8ynY7blh/edit#slide=id.p1
  2. Video Walkthrough - Coming Soon!
  3. Q & A - Coming Soon!

πŸ› οΈ How is this done (5 simple steps!)?

This is achieved using the new Workflow Builder feature in Slack and External Services in Salesforce. Here are the steps in brief:

  1. Using the Slack Workflow Builder, create and publish a Workflow that post messages into a Slack Channel and is triggered by a Webhook. Read for more info: https://slack.com/intl/en-in/help/articles/360035692513-Guide-to-Workflow-Builder.

  2. Construct a Swagger Schema for the Webhook provided by Slack (in Step 1). Use the Template given below to get started.

  3. Created a Named Credential in Salesforce with URL - https://hooks.slack.com. (No Auth)

  4. Import the Swagger Schema constructed in Step 2 using External Services.

  5. Create a Flow as shown below: image

πŸ“‹ Template Swagger Schema

{
  "swagger": "2.0",
  "info": {
    "title": "Slack + Salesforce",
    "description": "Instantly Send Messages to Slack from Salesforce",
    "version": "1.0.0"
  },
  "host": "hooks.slack.com",
  "schemes": [ "https" ],
  "paths": {
    "[REPLACE THIS WITH YOUR WEBHOOK]": {
      "post": {
        "consumes": [ "application/json" ],
        "parameters": [
          {
            "in": "body",
            "name": "slackMessageRequest",
            "type": "object",
            "required": true,
            "schema" : {
              "$ref" : "#/definitions/SlackMessageRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Operation"
          }
        }
      }
    }
  },
  "definitions": {
    "SlackMessageRequest": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    }
  }
}

⚠️ Note: To validate a Swagger Schema (written by yourself), visit - http://editor.swagger.io/.

⚠️ Note: Please DO NOT forget to replace [REPLACE THIS WITH YOUR WEBHOOK] in the above Template Swagger Schema with the Webhook of your Slack Workflow.

πŸ”— Resources

  1. Trailhead https://trailhead.salesforce.com/en/content/learn/modules/external-services
  2. Blogs https://shrutisridharan.wordpress.com/tag/external-services/

About

Integrate Slack and Salesforce in 20 mins! πŸ’¬πŸŒ©οΈπŸŒ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published