Skip to content

Commit 22e4ce2

Browse files
committed
[ACTION] Salesforce Accounts/Opportunities Batch Create/UpdateDD
1 parent 1b4d96e commit 22e4ce2

File tree

56 files changed

+258
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+258
-51
lines changed

components/salesforce_rest_api/actions/add-contact-to-campaign/add-contact-to-campaign.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "salesforce_rest_api-add-contact-to-campaign",
66
name: "Add Contact to Campaign",
77
description: "Adds an existing contact to an existing campaign. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_campaignmember.htm)",
8-
version: "0.1.0",
8+
version: "0.1.1",
99
type: "action",
1010
props: {
1111
salesforce,

components/salesforce_rest_api/actions/add-lead-to-campaign/add-lead-to-campaign.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "salesforce_rest_api-add-lead-to-campaign",
66
name: "Add Lead to Campaign",
77
description: "Adds an existing lead to an existing campaign. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_campaignmember.htm)",
8-
version: "0.1.0",
8+
version: "0.1.1",
99
type: "action",
1010
props: {
1111
salesforce,
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import {
2+
ConfigurationError,
3+
getFileStream,
4+
} from "@pipedream/platform";
5+
import app from "../../salesforce_rest_api.app.mjs";
6+
7+
export default {
8+
props: {
9+
app,
10+
csvFilePath: {
11+
type: "string",
12+
label: "CSV File Path Or URL",
13+
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)",
14+
},
15+
},
16+
methods: {
17+
getObject() {
18+
throw new ConfigurationError("getObject method not implemented");
19+
},
20+
getOperation() {
21+
throw new ConfigurationError("getOperation method not implemented");
22+
},
23+
getSummary() {
24+
throw new ConfigurationError("getSummary method not implemented");
25+
},
26+
async processBulkOperation({
27+
object, operation, csvData, externalIdFieldName, ...args
28+
} = {}) {
29+
const { app } = this;
30+
const job = await app.createBulkJob({
31+
...args,
32+
data: {
33+
object,
34+
operation,
35+
externalIdFieldName,
36+
},
37+
});
38+
39+
await app.uploadBulkJobData({
40+
...args,
41+
jobId: job.id,
42+
data: csvData,
43+
});
44+
45+
await app.patchBulkJob({
46+
...args,
47+
jobId: job.id,
48+
data: {
49+
state: "UploadComplete",
50+
},
51+
});
52+
53+
return app.getBulkJobInfo({
54+
...args,
55+
jobId: job.id,
56+
});
57+
},
58+
},
59+
async run({ $ }) {
60+
const {
61+
processBulkOperation,
62+
getObject,
63+
getOperation,
64+
getSummary,
65+
csvFilePath,
66+
} = this;
67+
68+
const csvData = await getFileStream(csvFilePath);
69+
70+
const result = await processBulkOperation({
71+
$,
72+
object: getObject(),
73+
operation: getOperation(),
74+
csvData,
75+
});
76+
77+
$.export("$summary", getSummary());
78+
79+
return result;
80+
},
81+
};

components/salesforce_rest_api/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "salesforce_rest_api-convert-soap-xml-to-json",
66
name: "Convert SOAP XML Object to JSON",
77
description: "Converts a SOAP XML Object received from Salesforce to JSON",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
type: "action",
1010
props: {
1111
salesforce_rest_api,

components/salesforce_rest_api/actions/create-account/create-account.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "salesforce_rest_api-create-account",
99
name: "Create Account",
1010
description: `Creates a Salesforce account. [See the documentation](${docsLink})`,
11-
version: "0.3.1",
11+
version: "0.3.2",
1212
type: "action",
1313
methods: {
1414
...common.methods,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import common from "../common/batch-operation.mjs";
2+
3+
export default {
4+
...common,
5+
key: "salesforce_rest_api-create-accounts-batch",
6+
name: "Create Accounts (Batch)",
7+
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)",
8+
version: "0.0.1",
9+
type: "action",
10+
methods: {
11+
getObject() {
12+
return "Account";
13+
},
14+
getOperation() {
15+
return "insert";
16+
},
17+
getSummary() {
18+
return "Successfully created Accounts";
19+
},
20+
},
21+
};

components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818
key: "salesforce_rest_api-create-attachment",
1919
name: "Create Attachment",
2020
description: `Creates an Attachment on a parent object. [See the documentation](${docsLink})`,
21-
version: "0.5.1",
21+
version: "0.5.2",
2222
type: "action",
2323
props,
2424
async run({ $ }) {

components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "salesforce_rest_api-create-campaign",
99
name: "Create Campaign",
1010
description: `Creates a marketing campaign. [See the documentation](${docsLink})`,
11-
version: "0.3.1",
11+
version: "0.3.2",
1212
type: "action",
1313
methods: {
1414
...common.methods,

components/salesforce_rest_api/actions/create-case/create-case.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "salesforce_rest_api-create-case",
99
name: "Create Case",
1010
description: `Creates a Case, which represents a customer issue or problem. [See the documentation](${docsLink})`,
11-
version: "0.3.1",
11+
version: "0.3.2",
1212
type: "action",
1313
methods: {
1414
...common.methods,

components/salesforce_rest_api/actions/create-casecomment/create-casecomment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
key: "salesforce_rest_api-create-casecomment",
1818
name: "Create Case Comment",
1919
description: `Creates a Case Comment on a selected Case. [See the documentation](${docsLink})`,
20-
version: "0.3.1",
20+
version: "0.3.2",
2121
type: "action",
2222
props,
2323
async run({ $ }) {

0 commit comments

Comments
 (0)