Skip to content

Commit 9ee5c69

Browse files
GTFalcaolcaresia
authored andcommitted
Salesforce source adjustment (#14626)
* version bumps * Adding fieldsToObtain prop * Adjustments
1 parent 8a602e4 commit 9ee5c69

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

components/salesforce_rest_api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/salesforce_rest_api",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Pipedream Salesforce (REST API) Components",
55
"main": "salesforce_rest_api.app.mjs",
66
"keywords": [

components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@ export default {
77
name: "New Record (Instant, of Selectable Type)",
88
key: "salesforce_rest_api-new-record-instant",
99
description: "Emit new event when a record of the selected object type is created. [See the documentation](https://sforce.co/3yPSJZy)",
10-
version: "0.1.0",
10+
version: "0.2.0",
11+
props: {
12+
...common.props,
13+
fieldsToObtain: {
14+
propDefinition: [
15+
common.props.salesforce,
16+
"fieldsToObtain",
17+
(c) => ({
18+
objType: c.objectType,
19+
}),
20+
],
21+
optional: true,
22+
description: "Select the field(s) to be retrieved for the records. Only applicable if the source is running on a timer. If running on a webhook, or if not specified, all fields will be retrieved.",
23+
},
24+
},
1125
hooks: {
1226
...common.hooks,
1327
async deploy() {
@@ -40,7 +54,7 @@ export default {
4054
Id: id,
4155
} = item;
4256
const entityType = startCase(objectType);
43-
const summary = `New ${entityType} created: ${name}`;
57+
const summary = `New ${entityType} created: ${name ?? id}`;
4458
const ts = Date.parse(createdDate);
4559
return {
4660
id,
@@ -57,7 +71,7 @@ export default {
5771
[nameField]: name,
5872
} = newObject;
5973
const entityType = startCase(this.objectType).toLowerCase();
60-
const summary = `New ${entityType} created: ${name}`;
74+
const summary = `New ${entityType} created: ${name ?? id}`;
6175
const ts = Date.parse(createdDate);
6276
return {
6377
id,
@@ -118,8 +132,11 @@ export default {
118132
setObjectTypeColumns,
119133
} = this;
120134

121-
const { fields } = await getObjectTypeDescription(objectType);
122-
const columns = fields.map(({ name }) => name);
135+
let columns = this.fieldsToObtain;
136+
if (!columns?.length) {
137+
const { fields } = await getObjectTypeDescription(objectType);
138+
columns = fields.map(({ name }) => name);
139+
}
123140

124141
setObjectTypeColumns(columns);
125142
},

0 commit comments

Comments
 (0)