top of page
Blog
Writer's pictureIryna Yamborska

Salesforce + Microsoft Teams: Step-by-Step Integration Guide

With new capabilities come exciting opportunities. Today we'll discuss how to integrate Salesforce with Microsoft Teams to enhance your team's collaboration.


Integrating Salesforce with Microsoft Teams


Integrating these two tools boosts efficiency by combining CRM data with a communication platform. This not only saves time but also simplifies access to essential information right where your team communicates and makes decisions.


Why Integrate Salesforce with Microsoft Teams?


  • Enhanced Collaboration: Share Salesforce records directly within Teams channels.

  • Instant Notifications: Receive notifications about important Salesforce events inside Teams.

  • Increased Productivity: Access Salesforce data without switching between applications.

  • Centralized Communication: All information and discussions are consolidated in one place.


When you integrate Salesforce with Microsoft Teams, you gain the ability to:
  • View and share Salesforce records directly within Teams.

  • Receive notifications about new leads, opportunities, or records updates.

  • Use the Salesforce bot for a quick information search.


How to Integrate Salesforce with Microsoft Teams: Step-by-Step Guide


Step 1: Installing the Salesforce App in Teams

  1. Open Microsoft Teams.

  2. Navigate to the Apps section on the left panel.

  3. Search for "Salesforce" and select the corresponding app.

  4. Click Add and choose whether to install the app in a team or a chat.

Step 2: Connecting to Salesforce

  1. After installing the app, you'll be prompted to log in to your Salesforce account.

  2. Enter your credentials and grant the necessary permissions.

  3. Select the environment: Production or Sandbox.

Step 3: Setting Preferences and Notifications

  1. Open Salesforce in Teams.

  2. Go to settings and select which notifications you want to receive.

  3. Configure filters for objects and events relevant to your needs.


How to Integrate Salesforce with Microsoft Teams: Step-by-Step Guide - Sparkybit


Salesforce & Microsoft Teams Integration: Use Case Examples

Example 1: Discussing a Record with Your Team

  1. In a Teams channel, type @Salesforce and enter the name of an opportunity.

  2. Select the relevant record from the suggested options.

  3. The information will appear directly in the chat, enabling the team to start discussions immediately.

Example 2: Receiving Notifications about New Leads

  1. Configure notifications for new lead creation in the Salesforce app.

  2. When a new lead is created, you'll receive a notification in Teams.

  3. Assign a responsible team member or discuss the next steps right away.

Example 3: Quick Access to Reports

  1. In a chat or channel, type @Salesforce reports.

  2. The bot will provide a list of available reports.

  3. Select the desired report to view directly in Teams.


Key Considerations for Salesforce and Microsoft Teams Integration

  • Data Security: Ensure that only authorized team members have access to sensitive data.

  • Team Training: Conduct training on how to use the integration effectively to maximize productivity.

  • Customization: Tailor notifications and access permissions to suit your team's needs.


Example of Sending Notifications from Salesforce to Microsoft Teams via a Custom Solution


If you want Salesforce to automatically send notifications to a specific Microsoft Teams channel when certain events occur, such as creating a new lead or updating a status, this integration method is for you.


Steps to Set Up


Create an Incoming Webhook in Microsoft Teams

  1. Open Microsoft Teams and go to the channel where you want to receive notifications.

  2. Click the three dots next to the channel name and select "Connectors."

  3. In the list of available connectors, find "Incoming Webhook."

  4. Click "Add" or "Configure."

  5. Provide a name for the webhook, such as "Salesforce Notifications."

  6. Optionally, upload an image to display alongside messages sent via this webhook.

  7. Click "Create."

  8. Copy the webhook URL — you'll need this to configure Salesforce.

  9. Click "Done."


Setting Up Notification Sending

Create an Apex Class for Sending HTTP Requests

public with sharing class SendTeamsNotification {

    @InvocableMethod
    public static void sendNotification(List<String> messages) {

        String webhookUrl = 'https://your-webhook-url'; // Your Webhook URL

        for (String message : messages) {

            HttpRequest req = new HttpRequest();

            req.setEndpoint(webhookUrl);
            req.setMethod('POST');
            req.setHeader('Content-Type', 'application/json');

            String body = '{"text": "' + message + '"}';
            req.setBody(body);

            Http http = new Http();

            try {
                HttpResponse res = http.send(req);
            } catch (Exception e) {
                System.debug('Error while sending notification: ' + e.getMessage());
            }
        }
    }
}

Add a call to this class in a trigger, and enjoy notifications in Teams.

Also, don't forget the following:
  • Security: Keep the webhook URL confidential. Do not share it with unauthorized users.

  • Salesforce Limits: Be mindful of the limits on the number of external calls (Governor Limits).

  • Message Formatting: Microsoft Teams supports Markdown and Adaptive Cards for more advanced message formatting.


Salesforce & Microsoft Teams Integration: Conclusion


Integrating Salesforce with Microsoft Teams provides a powerful tool for enhancing team collaboration and accelerating business processes. Now, all the necessary information is available right where you communicate and make decisions.



 



Oleg Minko, CTO at Sparkybit
Oleg Minko, CTO at Sparkybit

Let's unlock the full potential of Salesforce for your business


Our team has successfully implemented and customized Salesforce for many businesses, resulting in increased revenues and greater customer satisfaction. Let's talk about your case!




bottom of page