Skip to content

Conversation

@shadyshoha
Copy link

@shadyshoha shadyshoha commented Oct 29, 2025

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.

Behavior

Before:

  • Users had to select at least one field in fieldsToUpdate before additionalFields would appear
  • No way to use only additionalFields without manual field selection

After:

  • additionalFields appears immediately after selecting SObject Type and Record ID
  • Users can choose to:
    • Use only additionalFields (new capability)
    • Use only manual field selection (existing behavior, still works)
    • Use both together (existing behavior, still works)

Testing

  • Tested using only additionalFields to update records
  • Tested using only manual fieldsToUpdate selection (backward compatibility)
  • Tested using both fieldsToUpdate and additionalFields together

Related Issue

Fixes the issue where users could not use additionalFields without first selecting manual fields in the Salesforce Update Record action.

Summary by CodeRabbit

Release Notes

  • New Features
    • Fields selection is now optional when updating Salesforce records, providing greater flexibility in update operations.
    • Improved handling for scenarios where no fields are specified during record updates.

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.
@vercel
Copy link

vercel bot commented Oct 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 29, 2025 4:17am

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Oct 29, 2025
@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Walkthrough

The update-record action's fieldsToUpdate property is now optional, and the additionalProps logic is adjusted to conditionally generate selected field properties only when fieldsToUpdate is provided and contains values; otherwise, it returns an empty object.

Changes

Cohort / File(s) Summary
Salesforce REST API update-record action
components/salesforce_rest_api/actions/update-record/update-record.mjs
Made fieldsToUpdate optional by adding optional: true to propDefinition; adjusted additionalProps to skip field prop generation when fieldsToUpdate is absent or empty

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single file modification with straightforward conditional logic
  • Optional parameter addition with guarded prop generation
  • No complex control-flow changes or multi-pattern refactoring

Poem

🐰 Fields now optional, a lighter load,
No need to pick when none are owed,
The update-record hops with grace,
Conditional props in their rightful place! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Salesforce: Make fieldsToUpdate optional in Update Record action" directly and clearly describes the main change in the changeset. The raw summary confirms that the primary modification is making the fieldsToUpdate property optional and adjusting additionalProps to handle this gracefully. The title is specific, concise, and immediately communicates the purpose of the change without vague language or unnecessary noise.
Description Check ✅ Passed The pull request description addresses the core requirement of the template by clearly explaining the reasoning behind the change in the opening paragraph. While the description doesn't use the exact "## WHY" heading format specified in the template, the content comprehensively covers why the change was made, what was modified, how the behavior changed (with before/after comparison), and includes testing guidance and issue reference. The description is well-structured, complete, and provides sufficient context well beyond the minimal template requirement.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 883ddb3 and a60b96b.

📒 Files selected for processing (1)
  • components/salesforce_rest_api/actions/update-record/update-record.mjs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/salesforce_rest_api/actions/update-record/update-record.mjs (1)
components/salesforce_rest_api/actions/update-email-template/update-email-template.mjs (3)
  • selectedFieldProps (50-50)
  • selectedFields (49-49)
  • fields (47-47)
🔇 Additional comments (2)
components/salesforce_rest_api/actions/update-record/update-record.mjs (2)

47-47: LGTM! Prop is now optional as intended.

The addition of optional: true enables users to skip manual field selection and use additionalFields immediately, which aligns with the PR objectives. The presence of reloadProps: true ensures that dynamic props are updated when the selection changes.


61-66: Excellent defensive guard for optional fieldsToUpdate.

The conditional logic correctly handles all edge cases:

  • When fieldsToUpdate is undefined, null, or an empty array, selectedFieldProps remains an empty object
  • When fieldsToUpdate contains selections, the fields are filtered and converted as before
  • The guard prevents potential runtime errors from calling .includes() on undefined/null
  • Backward compatibility is maintained for existing workflows

The clear comment and explicit initialization make the intent and behavior easy to understand.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User submitted Submitted by a user

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants