# Salesforce and Workbot for Slack recipe

This use case guides you through connecting Salesforce and Workbot for Slack to Workato to create a powerful automation.

# What does this recipe do?

This recipe enables Workbot for Slack to display Salesforce customer account details directly within Slack. This automation triggers when a specific command is entered into Slack, bringing critical customer information directly to where discussions are happening without the need to switch applications or disrupt your workflow.

flowchart TD subgraph M[" "] direction TB subgraph D[&nbsp Workbot for Slack New command trigger &nbsp] direction RL mm(setup) --- mmm(Trigger) end subgraph H[&nbsp Salesforce Search records batch action &nbsp] hh(Action) --- E(setup) end end A([Create recipe]) -- Configure your recipe --> M --> B([Automated workflow]) D --> H classDef default fill:#fff,stroke:#67eadd,stroke-width:2px; classDef WorkatoTeal fill:#67eadd,stroke:#b3e0e1,stroke-width:2px,color:#000; classDef SubgraphDash fill:#e1fffc,stroke:#f66,stroke-width:2px,color:#000,stroke-dasharray: 5 5 class D,H SubgraphDash class A,B,mm,mmm,hh,E WorkatoTeal

# Create your recipe

Complete the following steps to create a recipe that displays Salesforce account details in Slack:

USE CASES ARE INTENDED AS EXAMPLES ONLY

This use case is intended to serve as an example. Recipe modifications such as trigger and action configuration and conditional logic may require adjustments if you plan to include this recipe in your own workflow.

1

Sign in to your Workato account and navigate to the workspace project where you plan to add the recipe.

2

Set up connections for Salesforce and Workbot for Slack using the steps in the following sections:

Set up your Salesforce connection.

Complete the following steps to set up your Salesforce connection:

1

Click Create > Connection.

2

Search for Salesforce in the New Connection page.

3

Provide a name for your connection in the Connection name field.

Salesforce connection setupSalesforce connection setup

4

Use the Location drop-down menu to select the project where you plan to store the connection.

5

Use the Sandbox dropdown-menu to determine the account connection type.

6

Optional. Click Advanced to configure advanced connection options.

7

Optional. Select the Custom OAuth profile. App requests use the profile specified in Workato when you select this option. This ensures that the connection is restricted to the same set of scopes you selected for all users with the profile, and the authentication flow uses the client app linked to the custom profile.

8

Click Connect, enter your Salesforce account credentials when prompted, and then click Log In to verify the connection.

Salesforce connection setupLog in to your Salesforce account

Set up your Workbot for Slack connection.
1

Click Create > Connection.

2

Search for and select Workbot for Slack in the New Connection page.

3

Provide a name for your connection in the Name field.

Workbot for Slack connection setupWorkbot for Slack connection setup

4

Use the Location drop-down menu to select the project where you plan to store the connection.

5

Optional. Select the NLU provider you plan to use, such as DialogFlow or Amazon Lex NLU. You must connect to the NLU provider for it to appear in the drop-down menu.

6

Optional. Click Advanced to configure Slash commands verification tokens, custom help content, your Slack app status (classic or not), and your Custom OAuth profile.

7

Click Connect, sign in to your Slack workspace when prompted, and click Continue to verify the connection.

3

Click Create > Recipe.

4

Provide a name for your recipe in the Name field and select the project in which you plan to store the recipe from the Location drop-down menu.

5

Ensure that Trigger from an app is selected under Pick a starting point and click Start building.

Set up your recipeSet up your recipe

6
Set up your Workbot for Slack trigger.
1

Search for Workbot for Slack in the Choose an app search box and select the Slack connection app you created in the preceding steps.

Choose an appChoose Workbot for Slack as your app

2

Select New command as your trigger.

3

Click Save.

7

Click the + Add step button and select Action in app.

Add actionAdd action

8
Set up your Salesforce Search records (Account) batch action.
1

Search for Salesforce in the Choose an app search box and select the Salesforce connection you created in the preceding steps.

Choose an appChoose Salesforce as your app

2

Select Search records (Account) batch as your action.

3

Select Account from the Search for drop-down menu and map the Workbot for Slack Name | Step 1 datapill into the Account name field.

Salesforce action configurationSalesforce action configuration

9

Click the + Add step button and select IF condition.

How do IF conditions work?

An IF condition enables you to make decisions based on specific conditions. You can control your recipe workflow by executing different actions depending on whether a condition you specify is present or not present (true or false).

flowchart TD A([Search accounts in Salesforce]) --> B(Is the account present?) B -->|Yes| C(Return the account details in Slack.) B ---->|No| E(Return a message in Slack that \n the account is not present in Salesforce.) classDef default fill:#67eadd,stroke:#b3e0e1,stroke-width:2px,color:#000; classDef WorkatoPink fill:#f3c1c2,stroke:#f3c1c2,stroke-width:1px; class E WorkatoPink
10
Set up your Salesforce Account ID is not present IF condition.
1

Select Account ID under Salesforce Search Accounts (Step 2 output) to add the Account ID | Step 2 datapill to the Data field.

If condition is not presentConfigure IF condition is not present

2

Use the Condition drop-down menu to select is not present.

3

Click the + Add step button in the Yes statement and select Action in app.

If condition is met configurationSelect the app and action when the condition is met

4

Search for and select Workbot for Slack as the app and select Post command reply as your action.

5

Click the Add block to message button > select Section with text from the Type menu > map the Workbot for Slack Name | Step 1 datapill to the Section text field > and then map the Workbot for Slack Name | Step 1 datapill to the Attachment text field.

If condition is not presentConfigure your post reply message

6

Click the + Add step button under the No statement, search for and select Workbot for Slack as your app, and select Post command reply as your action.

If condition is met configurationSelect the app and action when the condition is met

11

Click the + Add step button and select IF condition.

12
Set up your Salesforce Account ID is present IF condition.
1

Map the Salesforce Account ID | Step 2 datapill into the Data field and enter is present in the Condition field.

If condition is presentConfigure IF condition is present

2

Click the Add block to message button > select Section with text from the Type menu > and enter your message in the Section text field.

Section textConfigure the section text

3

Click the Divider Show button > select Divider from the Type drop-down menu and > and map the Account ID | Step 2 and Account Name | Step 2 datapills into the Section text field.

DividerConfigure the divider

4

Click the Attachment fields Show button and add the account information you plan to display in your reply. For example, enter Name in the Title field and map the Account phone | Step 2 datapill into the Value field.

5

Click Save.

Your Workbot for Slack and Salesforce recipe is ready to test and implement.


Last updated: 11/4/2024, 6:09:46 PM