Microsoft Outlook Grid Integration
The Microsoft Outlook Grid integration brings live Outlook emails and calendar events directly into AppColab Grid via Microsoft Graph. Sales and service reps can view recent email communication threads and upcoming calendar meetings linked to their Salesforce Contacts without ever leaving the CRM.
What’s Deployed
| Component | Name | Purpose |
|---|---|---|
| Auth. Provider | Outlook_Microsoft_OAuth |
OpenID Connect provider managing token exchange and automatic refresh |
| Named Credential | Outlook |
Connects to https://graph.microsoft.com via Outlook External Credential |
| External Credential | Outlook |
OAuth 2.0 authentication linked to Outlook_Microsoft_OAuth Auth Provider |
| Apex Client | OutlookClient.cls |
Microsoft Graph REST client supporting /me/messages and /me/events queries |
| Apex Data Provider | OutlookGridDataProvider.cls |
Implements appcg.GridDataProviderV1 with server-side pagination and parent email filtering |
| Permission Set | Integration_Admin / Outlook_Integration |
Grants access to the Outlook → ApiKey external credential principal |
One-Time Manual Setup
1. Register App in Microsoft Azure Portal
- Sign in to the Microsoft Entra / Azure Portal and navigate to App registrations.
- Click New registration:
- Name:
AppColab Grid Outlook Integration - Supported account types: Select “Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)”.
[!IMPORTANT] Selecting Multitenant + Personal accounts ensures both corporate Microsoft 365 and personal
@outlook.com/@hotmail.comaccounts can sign in. - Redirect URI: Select Web (leave URL blank for now).
- Click Register.
- Name:
- Under Overview, copy your Application (client) ID.
- In the left navigation menu, go to Certificates & secrets:
- Click New client secret → add description (e.g.
Salesforce Grid Outlook). - Click Add and immediately copy the Value.
- Click New client secret → add description (e.g.
- In the left navigation menu, go to API permissions:
- Click Add a permission → select Microsoft Graph → Delegated permissions.
- Add the following scopes:
Mail.Read(read emails in Outlook mailbox)Calendars.Read(read calendar meetings)offline_access(maintain permanent refresh token)openid,profile,email
- Click Add permissions.
2. Configure Salesforce Auth. Provider
- In Salesforce Setup, enter Auth. Providers in the Quick Find box and click New:
- Provider Type:
OpenIdConnect - Name:
Outlook_Microsoft_OAuth - URL Suffix:
Outlook_Microsoft_OAuth - Consumer Key: Paste your Azure Application (client) ID from Step 1
- Consumer Secret: Paste your Azure Client Secret Value from Step 1
- Authorize Endpoint URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize[!IMPORTANT] Ensure you use the
/common/endpoint in the URL, NOT/organizations/. The/organizations/endpoint rejects personal Microsoft accounts with an error. - Token Endpoint URL:
https://login.microsoftonline.com/common/oauth2/v2.0/token - Default Scopes:
offline_access openid profile email https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/Calendars.Read
- Provider Type:
- Click Save.
- Scroll down and copy the generated Callback URL (e.g.
https://yourdomain.my.salesforce.com/services/authcallback/Outlook_Microsoft_OAuth). - In Azure Portal under your App Registration > Authentication > Web, click Add URI, paste the Salesforce Callback URL, and click Save.
3. Configure Credentials in Salesforce Setup
3.1 Create the External Credential
- In Salesforce Setup, enter Named Credentials in Quick Find.
- Click the External Credentials tab → click New:
- Label:
Outlook - Name:
Outlook - Authentication Protocol:
OAuth 2.0 - Authentication Provider: Select
Outlook_Microsoft_OAuth - Scope:
offline_access openid profile email https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/Calendars.Read - Click Save.
- Label:
- In the Principals section, click New:
- Parameter Name:
ApiKey - Sequence:
1 - Identity Type:
Named Principal - Scope:
offline_access openid profile email https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/Calendars.Read - Click Save.
- Parameter Name:
- On the
ApiKeyrow, click the dropdown action arrow▼→ click Authenticate:- Sign in with your Microsoft account in the popup.
- Click Accept to authorize mailbox and calendar read permissions.
- Confirm the Principal status turns to Configured with a green checkmark.
3.2 Create the Named Credential
- Click the Named Credentials tab (next to External Credentials) → click New:
- Label:
Outlook - Name:
Outlook - URL:
https://graph.microsoft.com - External Credential: Select
Outlook - Generate Authorization Header: Checked
- Allow Formulas in HTTP Header: Checked
- Label:
- Click Save.
4. Assign Permission Set Access
- In Salesforce Setup, enter Permission Sets in Quick Find.
- Select Integration Admin (or
Outlook_Integration/ your custom admin permission set). - Click External Credential Principal Access → click Edit.
- Add
Outlook - ApiKeyto Enabled External Credential Principals. - Click Save and verify the permission set is assigned to your Salesforce users.
Creating an Outlook Grid Definition
- In Salesforce, open AppColab Grid app → Grid Definitions tab → click New Grid Definition.
- Fill in:
- Grid Settings Name:
Contact_Outlook_Messages_Grid - Grid Label:
Contact Outlook Messages - Is Active?: Checked
- Data Provider Class:
OutlookGridDataProvider - Data Provider Configuration:
{ "resource": "messages", "parentMatchField": "Email" }Tip: Set
"resource"to"events"to create an Outlook Calendar Events grid.
- Grid Settings Name:
- Click Save & Next → proceed to Preview.
- Live Outlook email messages or calendar events load with Subject, Sender, Received Date, and Snippet!
Supported Grid Features
| Resource | Supported Actions | Columns |
|---|---|---|
| Messages (Emails) | View, Search, Filter, Open in Web | Subject, From Name, From Address, Received DateTime, Has Attachments, Body Preview, Web Link |
| Events (Calendar) | View, Search, Filter | Subject, Start Time, End Time, Organizer Name, Organizer Email, Location, Response Status |
Troubleshooting & Common Gotchas
- “You can’t sign in here with a personal account. Use your work or school account instead.”:
- Cause: In Salesforce Setup > Auth. Providers, the Authorize or Token URL has
/organizations/instead of/common/. - Fix: Edit
Outlook_Microsoft_OAuthand change URLs tohttps://login.microsoftonline.com/common/oauth2/v2.0/authorizeandhttps://login.microsoftonline.com/common/oauth2/v2.0/token. In Azure Portal, ensure Supported account types is Multitenant + Personal.
- Cause: In Salesforce Setup > Auth. Providers, the Authorize or Token URL has
- 0 records returned in Standalone Preview:
- Cause: When
"parentMatchField": "Email"is configured, the provider filters emails matching the parent record’sEmailfield. In a standalone preview or grid wizard, there is no parent record context (parentId == null), so 0 rows are returned by design. - Fix: Place the grid component on a Contact record page in Lightning App Builder to view matching emails.
- Cause: When
403 Forbidden / Access Denied:- Cause: Missing delegated scopes (
Mail.ReadorCalendars.Read) in Azure Portal or missing external credential principal permission. - Fix: Confirm permissions are granted in Azure and verify your user is assigned the permission set with
Outlook - ApiKeyaccess.
- Cause: Missing delegated scopes (