Skip to content

Commit a689f83

Browse files
Salesforce: Make fieldsToUpdate optional in Update Record action (#18890)
* Salesforce: Make fieldsToUpdate optional in Update Record action Update the Salesforce Update Record action to make the fieldsToUpdate prop optional, allowing users to utilize the additionalFields prop immediately after selecting the SObject Type without needing to manually select fields first. Changes: - Made fieldsToUpdate prop optional in update-record.mjs - Updated additionalProps() to handle empty fieldsToUpdate gracefully - additionalFields now appears immediately after SObject Type selection This change maintains backward compatibility with existing workflows that use manual field selection while providing a more flexible workflow for users who prefer to specify all fields via additionalFields. * updates --------- Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: michelle0927 <[email protected]>
1 parent 466f280 commit a689f83

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

components/salesforce_rest_api/actions/update-record/update-record.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "salesforce_rest_api-update-record",
99
name: "Update Record",
1010
description: "Update fields of a record. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_update_fields.htm)",
11-
version: "0.3.4",
11+
version: "0.3.5",
1212
annotations: {
1313
destructiveHint: true,
1414
openWorldHint: true,
@@ -23,7 +23,7 @@ export default {
2323
"objectType",
2424
],
2525
description: "The type of object to update a record of.",
26-
26+
reloadProps: true,
2727
},
2828
recordId: {
2929
propDefinition: [
@@ -44,6 +44,7 @@ export default {
4444
objType: c.sobjectType,
4545
}),
4646
],
47+
optional: true,
4748
reloadProps: true,
4849
},
4950
},
@@ -57,8 +58,12 @@ export default {
5758
} = this;
5859
const fields = await this.salesforce.getFieldsForObjectType(sobjectType);
5960

60-
const selectedFields = fields.filter(({ name }) => fieldsToUpdate.includes(name));
61-
const selectedFieldProps = this.convertFieldsToProps(selectedFields);
61+
// Only generate props for manually selected fields if any were selected
62+
let selectedFieldProps = {};
63+
if (fieldsToUpdate && fieldsToUpdate.length > 0) {
64+
const selectedFields = fields.filter(({ name }) => fieldsToUpdate.includes(name));
65+
selectedFieldProps = this.convertFieldsToProps(selectedFields);
66+
}
6267

6368
return {
6469
docsInfo: {

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.10.0",
3+
"version": "1.10.1",
44
"description": "Pipedream Salesforce (REST API) Components",
55
"main": "salesforce_rest_api.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)