-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[ACTION] Salesforce Accounts/Opportunities Batch Create/UpdateDD #18201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jcortes
merged 1 commit into
master
from
salesforce-accounts-opportunities-batch-create-update
Sep 1, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
components/salesforce_rest_api/actions/common/batch-operation.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import { | ||
| ConfigurationError, | ||
| getFileStream, | ||
| } from "@pipedream/platform"; | ||
| import app from "../../salesforce_rest_api.app.mjs"; | ||
|
|
||
| export default { | ||
| props: { | ||
| app, | ||
| csvFilePath: { | ||
| type: "string", | ||
| label: "CSV File Path Or URL", | ||
| description: "The path to the CSV file to process. Provide a path to a file in the `/tmp` directory (for example, `/tmp/data.csv`). If a URL is provided, the file will be downloaded to the `/tmp` directory. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_data.htm)", | ||
| }, | ||
| syncDir: { | ||
| type: "dir", | ||
| accessMode: "read", | ||
| sync: true, | ||
| }, | ||
| }, | ||
| methods: { | ||
| getObject() { | ||
| throw new ConfigurationError("getObject method not implemented"); | ||
| }, | ||
| getOperation() { | ||
| throw new ConfigurationError("getOperation method not implemented"); | ||
| }, | ||
| getSummary() { | ||
| throw new ConfigurationError("getSummary method not implemented"); | ||
| }, | ||
| async processBulkOperation({ | ||
| object, operation, csvData, externalIdFieldName, ...args | ||
| } = {}) { | ||
| const { app } = this; | ||
| const job = await app.createBulkJob({ | ||
| ...args, | ||
| data: { | ||
| object, | ||
| operation, | ||
| externalIdFieldName, | ||
| }, | ||
| }); | ||
|
|
||
| await app.uploadBulkJobData({ | ||
| ...args, | ||
| jobId: job.id, | ||
| data: csvData, | ||
| }); | ||
|
|
||
| await app.patchBulkJob({ | ||
| ...args, | ||
| jobId: job.id, | ||
| data: { | ||
| state: "UploadComplete", | ||
| }, | ||
| }); | ||
|
|
||
| return app.getBulkJobInfo({ | ||
| ...args, | ||
| jobId: job.id, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| processBulkOperation, | ||
| getObject, | ||
| getOperation, | ||
| getSummary, | ||
| csvFilePath, | ||
| } = this; | ||
|
|
||
| const csvData = await getFileStream(csvFilePath); | ||
|
|
||
| const result = await processBulkOperation({ | ||
| $, | ||
| object: getObject(), | ||
| operation: getOperation(), | ||
| csvData, | ||
| }); | ||
|
|
||
| $.export("$summary", getSummary()); | ||
|
|
||
| return result; | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import common from "../common/batch-operation.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "salesforce_rest_api-create-accounts-batch", | ||
| name: "Create Accounts (Batch)", | ||
| description: "Create multiple Accounts in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| methods: { | ||
| ...common.methods, | ||
| getObject() { | ||
| return "Account"; | ||
| }, | ||
| getOperation() { | ||
| return "insert"; | ||
| }, | ||
| getSummary() { | ||
| return "Successfully created Accounts"; | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...nts/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import common from "../common/batch-operation.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "salesforce_rest_api-create-opportunities-batch", | ||
| name: "Create Opportunities (Batch)", | ||
| description: "Create multiple Opportunities in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| methods: { | ||
| ...common.methods, | ||
| getObject() { | ||
| return "Opportunity"; | ||
| }, | ||
| getOperation() { | ||
| return "insert"; | ||
| }, | ||
| getSummary() { | ||
| return "Successfully created Opportunities"; | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.