Salesforce Record Detail Enrichment for Teams Card
When a user posts a Salesforce record ID in a Teams channel, the flow fetches the full record details and replies with a rich adaptive card showing key fields, owner, last modified date, and a direct link to Salesforce.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This on-demand flow fetches a Salesforce record by its ID and posts a rich, styled HTML summary to a Microsoft Teams channel. The card displays key fields (Name, Owner, Created Date, Last Modified, Status) and a direct link back to Salesforce, enabling sales teams to share record details without switching apps.
Use Case
Sales teams and business users frequently need to share Salesforce record details in Teams conversations. Instead of switching between apps, copying fields manually, or sharing raw URLs, this flow lets a user enter a Record ID and instantly post a formatted summary card to a Teams channel.
The flow is ideal for teams that:
- One-click Salesforce record lookup — no manual copy-paste
- Rich HTML card with styled layout — professional appearance
- Works across Salesforce object types — Account, Contact, Opportunity, etc.
- Field fallbacks handle multiple object schemas — same flow for any object
- Fully env-var-driven — re-target to different objects without flow edits
Flow Architecture
Manually trigger a flow
Manually trigger a flowButton trigger with one required input: Salesforce_Record_ID (15 or 18-char ID).
Initialize variables (parallel)
4x Initialize VariableLoad environment variables in parallel: TeamsGroupId, TeamsChannelId, SalesforceObjectType, SalesforceInstanceUrl.
Get Salesforce Record
Salesforce - GetItemFetch the record from Salesforce using a dynamic table parameter sourced from varSalesforceObjectType and the supplied Record ID.
Compose Record Summary
ComposeBuild a styled HTML card with a gradient header, a data table (Name, Owner, Created Date, Last Modified, Status) and a direct Salesforce link.
Post Record Details to Teams
Teams - PostMessageToConversationPost the composed HTML card to the configured Teams group and channel.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TeamsGroupId | String | <configure> | GUID of the Teams group (team) that owns the destination channel. |
| flowlibs_TeamsChannelId | String | <configure> | Channel ID where the Salesforce record summary card is posted. |
| flowlibs_SalesforceObjectType | String | Account | API name of the Salesforce object to look up (e.g. Account, Contact, Opportunity, Case). |
| flowlibs_SalesforceInstanceUrl | String | https://yourorg.my.salesforce.com | Base URL of your Salesforce org, used to build direct record links in the card. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Salesforce | shared_salesforce | GetItem (fetch record by ID; dynamic table from varSalesforceObjectType) |
| Microsoft Teams | shared_teams | PostMessageToConversation (post HTML card to configured channel) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Deploy to another environment
- Import the solution, update the four environment variables with your target Teams group/channel and Salesforce instance URL, bind the Salesforce and Teams connection references, set flowlibs_SalesforceObjectType to your target object (Contact, Opportunity, Case, etc.), then turn the flow on.
- Change the Salesforce object type
- Update flowlibs_SalesforceObjectType (e.g. Contact, Opportunity, Case) to retarget the flow at a different Salesforce object without editing actions.
- Add more fields to the card
- Edit the Compose Record Summary action to include additional Salesforce fields using outputs('Get_Salesforce_Record')?['body/FieldName'].
- Customize the HTML card
- Modify the concat() expression in Compose Record Summary to change colors, layout, or add a logo to match your brand.
- Target a different Teams channel
- Update flowlibs_TeamsGroupId and flowlibs_TeamsChannelId env vars to route the card to a different team or channel.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Status field fallback
Handles different Salesforce object schemas by falling back through Status, StageName, then Industry before defaulting to 'N/A'.
EXPR.02Dynamic table parameter
Used as the dynamic table parameter on the Salesforce GetItem action so the flow works for Account, Contact, Opportunity, etc.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.