Org Connections
A Slack app in a workspace is allowed to connect to one or more orgs for all Slack users in that workspace. When working with a Slack app, users are granted the power to connect, disconnect, or reconnect to different orgs. For example:
- Your org or scratch org expires or is no longer valid.
- You removed the app, which uninstalls and disconnects the app from the org.
Slack prompts you to log into a new org if your connected org has expired or is no longer valid.
When you run your Slack app for the first time a prompt is shown to connect to your Salesforce org. Whether it's through a slash command in a channel or accessing the Home page in the app, Slack prompts you to connect.
Follow the on-screen instructions to connect your Slack workspace to your Salesforce org.
After connecting to your Salesforce org, another prompt grants your Slack app permission to access the workspace. If your app includes the chat:write
scope, you must also select a channel to post to.
Finally, you get a prompt to allow Slack to access your Salesforce account. Following this step, you can run your app in the channel you selected.
If you have to connect an org you previously connected to, you must use the same Salesforce user that was used when you initially connected.
Disconnecting an org includes disassociating the app and workspace from the org, enabling you to target new orgs with a new user.
To disconnect your Slack app from an org, make sure you configure your Slack app to subscribe to the corresponding bot events and then invoke the app uninstall.
- Subscribe to the
app_uninstalled
andtokens_revoked
bot events. Adding these events helps your app to know when your Slack app is uninstalled or when the API tokens for your app are revoked. See Choosing event subscriptions. - Uninstall your app by following the steps at Remove apps and custom integrations from your workspace.
Connect up to five Salesforce orgs to a single Slack Workspace with the Salesforce for Slack Multi-Org management feature. The Salesforce for Slack app provides Salesforce Admins and standard users the ability to have access to multiple Salesforce orgs in Slack. Standard users can set their Preferred org connection. Users can connect or disconnect their individual user account from any org that they’re connected to.
To initially connect a Salesforce org to Slack you must be a Salesforce Admin or have the Manage Slack App Organization Connections for Slack Apps permission.
- Click Connect New Org.
- Sign into the org that you would like to connect to Slack.
- Click Allow to connect your org to Slack.
- Agree to Slack accessing Salesforce data by clicking the checkbox and then Allow.
- A confirmation message appears and you can close the browser window.
- Open Salesforce for Slack in your Slack workspace.
- Select the Home tab in the app.
- Click Manage Orgs. The management window appears with an updated list of current connections.
The Multi-Org feature allows you to connect multiple Salesforce orgs to one Slack workspace. To access this feature use a button on the Salesforce for Slack Home tab or a slash command.
To Manage an Existing Connection:
- Open Salesforce for Slack in your Slack workspace.
- Select the Home tab in the app.
- Click Manage Orgs. The management window appears with an updated list of current connections.
- Select your Salesforce org and click Manage to see additional details.
As a Standard User you can:
- Connect and disconnect your Salesforce user.
- Set the selected connection as the preferred.
- View the selected preferred Salesforce org.
A Salesforce admin can also perform the following tasks:
- Disconnect a connection.
- Set a selected connection as the default connection.
- View the selected default connection.
The Preferred and Default labels determine which Salesforce org handles any action based on the user preference.
- Preferred: The Preferred org takes the highest precedence. The user sets their own Preferred org. When slash commands or shortcuts are run, the Preferred org is used.
- Default: The Default org is set by the Salesforce Admin. If a Preferred org isn’t set, the Default org is used as an alternative.