Skip to content

Commit 66ac239

Browse files
committed
Adding fieldsToObtain prop
1 parent 2a0bd0c commit 66ac239

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ export default {
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)",
1010
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() {
@@ -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) {
137+
const { fields } = await getObjectTypeDescription(objectType);
138+
columns = fields.map(({ name }) => name);
139+
}
123140

124141
setObjectTypeColumns(columns);
125142
},

0 commit comments

Comments
 (0)