Sample app to showcase Slack + Salesforce integrations.
This app has been created using the Salesforce Slack Starter Kit. For a detailed explanation of the app architecture and the scaffolding script, take a look at Salesforce Slack Starter Kit's README.
To be able to run this project you will need:
git
>= 1.22 (download here)node
>= 14 (download here)sfdx
CLI >= sfdx-cli/7.142.0 (download here)heroku
CLI (download here)git clone https://github.com/trailheadapps/ready-to-fly
sf org login web --set-default -a mydevorg
heroku login
cd ready-to-fly/scripts
npm install
cd ..
node scripts/deploy.js
Choose Non-Scratch Org when the script prompts you to select Salesforce environment
Click Enter to accept the Heroku app name
The script prompts you to enter value for SLACK_BOT_TOKEN
. To enter this value open your apps configuration page by first navigating to the apps list and then selecting the app you created in previous section, click OAuth & Permissions in the left hand menu, then copy the value in Bot User OAuth Token and paste into terminal.
SLACK_SIGNING_SECRET
. To enter this value open your apps configuration page by first navigating to the apps list and then selecting the app you created in previous section, click Basic Information and scroll to the section App Credentials and click show button and copy the Signing Secret and paste into terminal.git clone https://github.com/trailheadapps/ready-to-fly
sf org login web --set-default-dev-hub -a DevHub
heroku login
cd ready-to-fly/scripts
npm install
cd ..
node scripts/deploy.js
Choose Scratch Org when the script prompts you to select Salesforce environment
Click Enter to accept the Heroku app name
The script prompts you to enter value for SLACK_BOT_TOKEN
. To enter this value open your configuration page by first navigating to the apps list and then selecting the app you created in previous section, click OAuth & Permissions in the left hand menu, then copy the value in Bot User OAuth Token and paste into terminal.
SLACK_SIGNING_SECRET
. To enter this value open your apps configuration page by first navigating to the apps list and then selecting the app you created in previous section, click Basic Information and scroll to the section App Credentials and click show button and copy the Signing Secret and paste into terminal.Note: As ready to fly performs calls from Salesforce to Slack, we've modified the Salesforce Slack Starter Kit script to deploy a named credential and a custom metadata type record used for callouts. We've also included the setup of some sample data.
This is the final step, you will need to enter the current Heroku Instance url in Slack App.
request_url
fields (there will be two to update) in the manifest and modify it to replace heroku-app
with your actual heroku domain name obtained from step 6 in previous section. Note at the end of this step your url should look like https://<heroku-domain>.herokuapp.com/slack/events
.sf project retrieve start
to retrieve and sf project deploy start
to deploy metadata from orgs to local project folder force-app
sf project retrieve start -d force-app/main/default
to retrieve and sf project deploy start -d force-app/main/default
to deploy metadata from orgs to local project folder force-app
cd apps/ready-to-fly
heroku git:remote -a <heroku app name>
git push heroku main
to push code to Heroku$ npm install ngrok -g
$ ngrok authtoken my_auth_token
$ ngrok http 3000
node app.js
from the project folder. You can then make changes to the code and restart the app as many times as you want.The Managers dropdown that appears when you create a travel request is populated with information pulled from Salesforce. Concretely, we look at the standard Manager field on the User object and pull two levels of Managers in the hirerachy. You can change that behavior to adapt it to your needs.