Speed and accuracy are crucial in any sales process. In this blog, we’ll learn how to send a Slack notification when a Salesforce Quote’s Total Price exceeds a certain amount, and how to Approve or Reject the Quote directly from Slack — without logging into Salesforce. This automation will make approvals faster and the process more efficient.
Now, let's start building the automation:
Step 1: Create an App in Slack
Go to Slack App
- Click Create New App → Select From scratch.
- Enter the name of the app and select the workspace.
-
Enable Incoming Webhooks to post messages from external systems to Slack and specify the channel in which you want to show the message coming from Salesforce.
-
Also, enable Interactivity & Shortcuts to interact with shortcuts, modals, or interactive components.
-
Set OAuth Permissions (like chat:write, incoming-webhook) for posting messages to specific channels.
Now, the app is created with all the necessary permissions.
Step 2: Create a Remote Site Setting
- Go to Setup.
- Search for Remote Site Settings in the Quick Find box and select it.
- Click New and enter the Remote Site Name and Remote Site URL.
-
Make sure to activate the site by selecting the checkbox.
Now, the remote site setting is created.
Step 3: Create an Apex Class for a Callout
- Go to the Developer Console.
- Create a new Apex Class and write the code as per your requirements, specifying which fields you want to display on the Slack channel.
- For the Webhook URL, go to the Slack app you created earlier, select the Incoming Webhook, copy the URL, and use it in your code.
Step 4: Create a Flow on the Quote Object
- Go to Setup.
- Search for Flow in the Quick Find box and select Flows under Process Automation.
- Click on New Flow, then select Start from Scratch and click Next.
- Select Record-Triggered Flow and click Create.
- Select the Quote Object, and choose when the record is created or updated.
-
Set the condition: Total Price is greater than 50,000.
- Set the flow to trigger every time a record is updated and meets the condition requirements.
-
Select Action and related records.
- Click on Add Element (+ icon) and select the Action element.
- In the search bar for the action, type the Apex class name for the callout to send the data to Slack.
-
Set Input Values for the selected action to pass the value to the Apex class.
-
Save and activate the flow.
Now, the flow is created, and when the Quote's total price is greater than 50,000, a message will be posted in the Slack channel.
"After posting the message to Slack, I have integrated Make.com to manage the approval or rejection of the Quote directly from the Slack interface. Once the action is taken, the Quote status will be instantly updated in Salesforce."
Step 5: Use Make.com
- Go to the Make.com website.
- Log in with your credentials.
- Click on Create a Scenario.
- Click on the + icon, select Webhook, and then choose Custom Webhook.
-
Copy the URL and go to your Slack app. Click on Interactivity & Shortcuts and paste the URL in the Request URL field.
- Run the scenario once. Then, go to the Slack channel, click on the Approve or Reject button, and the data will be sent to the custom webhook in Make.com (the scenario you are currently working on).
-
In Make.com, click on the + icon, select JSON, then choose Parse JSON. Here, select the payload (data coming from Slack).
- Click on the + icon, select Salesforce, and then choose Update a Record.
-
In the Record ID field, select the specified data from the JSON, and also map the Status for approval or rejection from Slack.
Record Id :
Status :
-
Save the scenario and turn it on.
Now, once the Quote's total price exceeds 50,000 and the message is posted on Slack, clicking on the Approve or Reject button will trigger the status change in Salesforce through Make.com, based on the action you choose.
Conclusion:
By integrating Slack, Salesforce, and Make.com, we’ve successfully automated the Quote approval process, streamlining workflows and ensuring quicker decision-making. This setup not only saves time but also reduces errors, making the sales process more efficient and seamless.
Have questions or need assistance? Feel free to contact us at support@astreait.com