Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(triggers): address PR review — remove non-TSDoc comment, fix gene…
…ric webhook instructions
  • Loading branch information
waleedlatif1 committed Apr 6, 2026
commit d67ab32a323cea4e37145f3cc457b6823917d60e
1 change: 0 additions & 1 deletion apps/sim/blocks/blocks/salesforce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
],
},
},
// Trigger subBlocks
...getTrigger('salesforce_record_created').subBlocks,
...getTrigger('salesforce_record_updated').subBlocks,
...getTrigger('salesforce_record_deleted').subBlocks,
Expand Down
33 changes: 23 additions & 10 deletions apps/sim/triggers/salesforce/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,29 @@ export const salesforceTriggerOptions = [
* Flow HTTP Callouts or Outbound Messages manually.
*/
export function salesforceSetupInstructions(eventType: string): string {
const instructions = [
'Copy the <strong>Webhook URL</strong> above.',
'In Salesforce, go to <strong>Setup → Flows</strong> and click <strong>New Flow</strong>.',
`Select <strong>Record-Triggered Flow</strong> and choose the object and <strong>${eventType}</strong> trigger condition.`,
'Add an <strong>HTTP Callout</strong> action — set the method to <strong>POST</strong> and paste the webhook URL.',
'In the request body, include the record fields you want sent as <strong>JSON</strong> (e.g., Id, Name, and any relevant fields).',
'Save and <strong>Activate</strong> the Flow.',
'Click <strong>"Save"</strong> above to activate your trigger.',
'<em>Alternative: You can also use <strong>Setup → Outbound Messages</strong> with a Workflow Rule, but this sends SOAP/XML instead of JSON.</em>',
]
const isGeneric = eventType === 'All Events'

const instructions = isGeneric
? [
'Copy the <strong>Webhook URL</strong> above.',
'In Salesforce, go to <strong>Setup → Flows</strong> and click <strong>New Flow</strong>.',
'Select <strong>Record-Triggered Flow</strong> and choose the object(s) you want to monitor.',
'Add an <strong>HTTP Callout</strong> action — set the method to <strong>POST</strong> and paste the webhook URL.',
'In the request body, include the record fields you want sent as <strong>JSON</strong> (e.g., Id, Name, and any relevant fields).',
'Repeat for each object type you want to send events for.',
'Save and <strong>Activate</strong> the Flow(s).',
'Click <strong>"Save"</strong> above to activate your trigger.',
]
: [
'Copy the <strong>Webhook URL</strong> above.',
'In Salesforce, go to <strong>Setup → Flows</strong> and click <strong>New Flow</strong>.',
`Select <strong>Record-Triggered Flow</strong> and choose the object and <strong>${eventType}</strong> trigger condition.`,
'Add an <strong>HTTP Callout</strong> action — set the method to <strong>POST</strong> and paste the webhook URL.',
'In the request body, include the record fields you want sent as <strong>JSON</strong> (e.g., Id, Name, and any relevant fields).',
'Save and <strong>Activate</strong> the Flow.',
'Click <strong>"Save"</strong> above to activate your trigger.',
'<em>Alternative: You can also use <strong>Setup → Outbound Messages</strong> with a Workflow Rule, but this sends SOAP/XML instead of JSON.</em>',
]

return instructions
.map(
Expand Down
Loading