Intercom Attachment Archive to SharePoint
When an Intercom conversation receives an attachment, the flow downloads it, files it to a structured SharePoint library (foldered by year/conversation), writes the file link back to the conversation as a note, and logs the archive to Dataverse. Keeps customer-supplied files in a governed, retained location instead of only inside Intercom.
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 flow archives Intercom conversation attachments into governed SharePoint storage and keeps an auditable record in Dataverse. It ships Off as a FlowLibs reference implementation - going live requires only authorizing the connections and setting the environment-variable values.
When a new Intercom conversation is created, the flow reads the full conversation over the Intercom REST API, collects every attachment (from the opening message and every reply part), and for each one: downloads the file, files it into a SharePoint library foldered by year / conversation id, logs an audit row to a Dataverse ledger (with a de-dup key so the same file is never archived twice), then writes the SharePoint links back onto the conversation as an internal note and emails a summary to the operations/compliance mailbox.
Why it matters: Customer-supplied files that live only inside Intercom fall outside Microsoft 365 retention, eDiscovery and backup. Mirroring them into SharePoint brings them under governance, with a link back so agents still see them in context.
Use Case
A support / compliance team needs customer attachments retained and discoverable in SharePoint while agents continue to see a link from the Intercom conversation. The Dataverse ledger provides an immutable audit trail - who the customer was, which file, where it landed in SharePoint, the retention label applied, and a correlation id that ties the note, the email and every row together.
Flow Architecture
When a New Intercom Conversation is Created
Intercom TrigNewConversationFires per new conversation (batch split).
Initialize variables (x12)
Initialize VariableCorrelation id, API base/version, admin id, workspace id, SharePoint site, folder root, retention label, notify email, counters.
Get Conversation Details
HTTP GET /conversations/{id}Reads the full conversation incl. source + parts attachments.
Get Customer Contact
Intercom GetLeadResolves customer email/name for the log and email.
Apply to each Conversation Part
Foreach (sequential)Unions each reply part's attachments into the master list.
Apply to each Attachment
Foreach (sequential)De-dups, archives, logs and counts each file.
List Existing Archive Record
Dataverse ListRecordsIdempotency lookup on the attachment key.
Download + Create SharePoint File
HTTP GET + SharePoint CreateFileFiles under <root>/<year>/<conversationId>.
Create Archive Log Record
Dataverse CreateRecordWrites the audit row (de-dup key) to the ledger.
Post Note To Conversation
HTTP POST /conversations/{id}/reply (note)Writes the SharePoint links back as an internal note.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_IntercomApiBase | String | https://api.intercom.io | Intercom REST base URL (HTTP calls). |
| flowlibs_IntercomApiToken | String | REPLACE_WITH_INTERCOM_TOKEN | Bearer token for the Intercom REST calls. |
| flowlibs_IntercomVersion | String | 2.11 | Intercom-Version header value. |
| flowlibs_IntercomAdminId | String | (configure) | Admin id that authors the internal note. |
| flowlibs_IntercomWorkspaceId | String | (configure) | Workspace/app id for building conversation deep links. |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint site used by CreateFile. |
| flowlibs_AdminAlertRecipientEmail | String | alerts@yourcompany.com | Recipient of the archive summary email. |
| flowlibs_IntercomArchiveFolderPath | String | /Shared Documents/Intercom Attachments | Server-relative library/folder root for archived files. |
| flowlibs_IntercomArchiveTableName | String | flowlibs_intercomattacharchives |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Intercom | shared_intercom | TrigNewConversation GetLead |
| SharePoint | shared_sharepointonline | CreateFile |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord |
| Office 365 Outlook | shared_office365 |
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.
- Catch mid-conversation attachments
- TrigNewConversation only fires on creation. To archive files added later, replace the trigger with a Recurrence poll of POST /conversations/search filtered by updated_at > watermark, then run the same per-conversation logic.
- File-type filter
- Add a Filter array (or Condition) on content_type / extension to skip inline images, signatures, or unwanted types.
- Real retention label
- SharePoint's connector has no retention op; the flow records the label as metadata. To apply a Microsoft Purview label, add an HTTP call to SharePoint REST SetComplianceTag (or Graph) after Create SharePoint File.
- De-dup by content hash
- The key is conversation id + file name; switch to a file hash if customers re-send identically named but different files.
- DLP / sensitivity scan
- Insert a scan step before Create SharePoint File to quarantine sensitive content.
- Folder taxonomy
- Change the CreateFile folderPath expression to folder by customer, month, or service line.
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.01Collect all attachments (seed)
Seed the attachment list from the source message.
EXPR.02Collect all attachments (per part)
Union each reply part's attachments.
EXPR.03De-dup key
Stable de-dup key = conversation id + file name.
EXPR.04SharePoint folder path
Year/conversation foldering.
EXPR.05Conversation deep link
Build the Intercom deep link.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.