SharePoint CSV Bulk Uploader to Salesforce
Monitors a SharePoint folder for new CSV files. On file creation, creates a bulk job for the target object, uploads the CSV via UploadJobData, closes the job to begin processing, and posts results to Teams.
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 automates bulk data loading into Salesforce by monitoring a SharePoint document library for new CSV drops. When a file lands, it spins up a Salesforce Bulk API 2.0 job against the configured target object, uploads the CSV payload, closes the job to start asynchronous processing, and notifies Teams with submission details (or a failure alert if anything breaks). It ships as a stopped flow inside a packaged solution and is driven entirely by environment variables — zero hard-coded endpoints, object names, or IDs.
Use Case
Operations teams frequently need to ingest large record sets into Salesforce on a recurring basis — nightly order exports, weekly contact refreshes, territory realignments, partner lead feeds. Manually running Data Loader or submitting Bulk jobs through Workbench is error-prone, gated on a single operator, and leaves no audit trail. By dropping a CSV into a governed SharePoint folder and letting this flow handle the rest, the business gets a repeatable, auditable, and multi-operator-friendly upload pipeline with Teams-based visibility into every submission.
Flow Architecture
When_A_New_CSV_Is_Uploaded
SharePoint - OnNewFilesPolling trigger (every 5 minutes) watching the configured CSV drop library. Uses splitOn @triggerOutputs()?['body/value'] so each new file runs in its own flow instance.
Init_varSharePointSiteUrl
Initialize variableLoads the flowlibs_SharePointSiteURL environment variable into varSharePointSiteUrl.
Init_varCsvDropLibraryPath
Initialize variableLoads the flowlibs_CsvDropLibraryPath environment variable into varCsvDropLibraryPath.
Init_varSalesforceTargetObject
Initialize variableLoads the flowlibs_SalesforceBulkTargetObject environment variable into varSalesforceTargetObject.
Init_varSalesforceBulkOperation
Initialize variableLoads the flowlibs_SalesforceBulkOperation environment variable into varSalesforceBulkOperation.
Init_varTeamsGroupId
Initialize variableLoads the flowlibs_TeamsGroupId environment variable into varTeamsGroupId.
Init_varTeamsChannelId
Initialize variableLoads the flowlibs_TeamsChannelId environment variable into varTeamsChannelId.
Get_CSV_File_Content
SharePoint - GetFileContentReads the binary content of the triggered CSV file using @triggerOutputs()?['body/Id'].
Create_Salesforce_Bulk_Job
Salesforce - CreateJobV2Creates a Bulk API 2.0 job with the target object and operation from env vars; uses columnDelimiter: COMMA and lineEnding: LF.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint site root URL used by the trigger and file read. Set to your tenant SharePoint site, e.g. https://your-tenant.sharepoint.com/sites/Ops. |
| flowlibs_CsvDropLibraryPath | String | /sites/Ops/Shared Documents/Salesforce Inbox | Server-relative folder path that the trigger polls for new CSV drops. |
| flowlibs_SalesforceBulkTargetObject | String | Contact | Salesforce API object name for the bulk job (e.g. Contact, Account, Lead, CustomObj__c). |
| flowlibs_SalesforceBulkOperation | String | insert | Bulk operation type: insert, update, upsert, or delete. For upsert, ensure the CSV has an external ID column. |
| flowlibs_TeamsGroupId | String | <configure> | Microsoft Teams team (group) ID for submission and failure notifications. |
| flowlibs_TeamsChannelId | String | <configure> | Microsoft Teams channel ID (e.g. 19:abc@thread.tacv2) within the team specified by flowlibs_TeamsGroupId. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| SharePoint Online | shared_sharepointonline | OnNewFiles (trigger) GetFileContent |
| Salesforce | shared_salesforce | CreateJobV2 UploadJobData CloseJob |
| Microsoft Teams | shared_teams | PostMessageToConversation (used twice (success + failure)) |
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.
- Swap the target Salesforce object
- Update the flowlibs_SalesforceBulkTargetObject env var — no flow edits required. Valid values are any Salesforce object API name reachable by the connection (Contact, Account, Lead, CustomObj__c, etc.).
- Switch operation mode
- Change flowlibs_SalesforceBulkOperation to insert, update, upsert, or delete. For upsert, ensure your CSV has an external ID column and that the connector bulk job references it (extend Create_Salesforce_Bulk_Job inputs with parameters/externalIdFieldName if needed).
- Tighten polling interval
- The trigger is set to 5-minute recurrence; lower to 1 minute by editing triggers.When_A_New_CSV_Is_Uploaded.recurrence.interval. Beware of connector throttle limits on very tight intervals.
- Add CSV validation
- Insert a Compose or schema-parse step between Get_CSV_File_Content and Create_Salesforce_Bulk_Job to reject malformed headers before creating a bulk job you would then have to abort.
- Route failures elsewhere
- The Post_Failure_Alert_To_Teams action uses the same Teams variables; split it into its own env vars if failure notifications should go to a separate ops 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.01Trigger splitter
splitOn expression so each new SharePoint file runs the flow in its own instance.
EXPR.02File Id reference
Passed to Get_CSV_File_Content to fetch the binary content of the triggering CSV.
EXPR.03File name reference
Used in the Teams notification cards to identify the uploaded file.
EXPR.04Bulk Job Id chaining
Used by Upload_Job_Data and Close_Job_To_Start_Processing to reference the newly created job.
EXPR.05Submission timestamp
Stamped into the Teams success card so operators can correlate with Salesforce Bulk Data Load Jobs.
EXPR.06Fan-in failure condition
Configures Post_Failure_Alert_To_Teams to run when any of the four Salesforce/SharePoint steps fails or times out.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.