Artisan IMG > Slack (slack) (6632c308-2cd1-4f68-8128-e521e552a66b)
Artisan IMG > Salesforce (salesforce) (dd966f42-81e8-4770-a3d8-d095ca41ab45)

Create Salesforce accts / opps with Slack modal

Workflow
Sales
Intermediate

This is a 'Workflow' template which means that it is a single standalone workflow.

Some workflow templates can be modified to work with other workflow templates - e.g. to convert a data sync between two services from uni-directional to bi-directional

Overview
Copy

The workflow is triggered by a Webhook trigger.

Once configured in Slack, the workflow serves as the initial integration point from the /test-referral slash command that generates a Modal on Slack to configure company details.

When the company details are configured, the workflow also serves as a receiver of the user input from the generated modal.

Two main workflow branches are handling both these events. The True branch takes the initial /test-referral slash command input and creates a Modal in Slack using a single HTTP client.

This Modal provides the interface for the requestor to enter details about the account and opportunity they would like to create in Salesforce.

Once this information is submitted through the Modal, the workflow is triggered again. The logic on the false branch creates the account and opportunity in Salesforce and messages the resulting IDs back to the user on Slack.

Refer to our Collect Response from a Slack Modal template for a generic example of creating a modal in Slack and then using the gathered information through the modal with a Service or a Database of your choice.

Connectors Used
Copy

The following connectors are used in this template.

This is mostly provided for reference only - there is no need to read through the linked connector pages. All you need to know for this template is explained here.

End Result
Copy

The below image shows the Modal generated using the /test-referral slash command. |It also shows a final message received on Slack when an account and an opportunity are created in Salesforce on the Submit action of the Modal.

Prerequisites
Copy

This workflow assumes the following:

  • Your team can authenticate to Slack and Salesforce

  • You have set up a Slack app and a slash command and can enable the interactivity settings

  • You have identified the required fields for creating the SFDC accounts and opportunities

Getting Live
Copy

To configure the workflow for your own use:

Workflow Logic
Copy

The overall logic of the workflow is:

  1. The workflow is triggered by two different Slack events. A separate branch in the workflow handles each event.

  2. The boolean condition checks which type of interaction triggered the workflow.

    • If the workflow is triggered with the /test-referral slash command, the true branch is executed, and it launches a modal on Slack for the user to configure their inputs.

    • Once the inputs are configured and submitted, the submit event triggers the workflow again, and the false branch is executed. The inputs configured on the modal are used to create the account and opportunity objects in Salesforce. Once created, a final message is sent on Slack to the user with links to the new objects. 

Step-by-step Explanation
Copy

True Branch
Copy

False Branch
Copy