English
Salesforce
Creates, finds and updates leads, contacts, accounts, opportunities, tasks and notes; attaches a document to a record; runs SOQL queries.
The Salesforce node acts on your Salesforce org through a Salesforce connection. Pick a Resource — Lead, Contact, Account, Opportunity, Task, Note — then an Operation: Create, Update, Get or Search. Two resources have no operation: Attach a file uploads an attachment of the run to a record, SOQL query runs a free-form read.
Fields are entered by their Salesforce API name (LastName, Company, StageName, Budget__c) in Fields; Fields as JSON accepts numbers, checkboxes and custom fields. An empty value is not sent: it does not clear the field in Salesforce.
At a glance
- Type:
salesforce.api· version 1 - Category: Data
- Kind: Step — one stage of a run
- Effect: Writes outside (
external_write) — writes outside Loop & Roll; described instead of performed during a test run - Needs a carrier email: No
- Connection: Salesforce
- Inputs:
main - Outputs:
main
Connection
This node needs a Salesforce connection.
Parameters
connection
Salesforce connection — The Salesforce connection to use. Create it once in Connections; its key never appears in the workflow.
- Type: Connection (
credential) - Required: Yes
- Default:
""(empty)
resource
Resource
- Type: One choice (
options) - Required: Yes
- Default:
lead - Options:
lead— Leadcontact— Contactaccount— Accountopportunity— Opportunitytask— Tasknote— Notefile— Attach a file: Uploads an attachment to a record (Files tab).query— SOQL query: A free-form read, for what the other operations do not cover.
operation
Operation
- Type: One choice (
options) - Required: Yes
- Default:
create - Options:
create— Createupdate— Updateget— Getsearch— Search: By email address for a lead or contact; by name (or subject, title) otherwise.
- Shown when:
resourceis one oflead,contact,account,opportunity,task,note
recordId
Record ID — The 15- or 18-character Salesforce ID (00Q…, 003…). For a file: the record that will receive it.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 18 characters at most
- Example:
{{ data.api_1.id }} - Shown when: (
resourceis one oflead,contact,account,opportunity,task,noteandoperationis one ofupdate,get) orresourceis one offile - Expressions:
{{ }}accepted
values
Fields — The field’s API name and its value. Lead: LastName, Company, Email, Phone, LeadSource, Description. Contact: LastName, FirstName, Email, AccountId. Opportunity: Name, StageName, CloseDate (YYYY-MM-DD), Amount. Task: Subject, WhoId, WhatId, ActivityDate. Note: ParentId, Title, Body. Values accept {{ }} expressions.
- Type: Key / value pairs (
keyValue) - Required: No
- Shown when:
resourceis one oflead,contact,account,opportunity,task,noteandoperationis one ofcreate,update - Expressions:
{{ }}accepted
fieldsJson
Fields as JSON (advanced) — For values that are not text (numbers, checkboxes) and custom fields (Budget__c). Merged over the fields above.
- Type: Long text (
text) - Required: No
- Default:
""(empty) - 20000 characters at most
- Example:
{ "Amount": 250000, "Budget__c": 1200 } - Shown when:
resourceis one oflead,contact,account,opportunity,task,noteandoperationis one ofcreate,update - Expressions:
{{ }}accepted
searchTerm
Search for — An exact email address (lead, contact), or part of a name.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Example:
{{ email.from.email }} - Shown when:
resourceis one oflead,contact,account,opportunity,task,noteandoperationis one ofsearch - Expressions:
{{ }}accepted
soql
SOQL query — A read: SELECT Id, Name FROM Account WHERE BillingCity = 'Lyon'. ⚠️ A value coming from an email must be quoted and contain no apostrophe; prefer “Search” for a sender.
- Type: Long text (
text) - Required: No
- Default:
""(empty) - 10000 characters at most
- Shown when:
resourceis one ofquery - Expressions:
{{ }}accepted
limit
Maximum count
- Type: Number (
number) - Required: No
- Default:
20 - Whole number, from 1 to 200
- Shown when: (
resourceis one oflead,contact,account,opportunity,task,noteandoperationis one ofsearch) orresourceis one ofquery
attachmentPosition
Attachment (position) — The attachment to upload: one from the email (1 for the first one) or a file added by an earlier step ({{ data.<step>.attachmentPosition }}).
- Type: Number (
number) - Required: No
- Default:
1 - Whole number, from 1 to 2000000
- Shown when:
resourceis one offile
fileTitle
File title — Empty: the attachment’s filename.
- Type: Text (
string) - Required: No
- Default:
""(empty) - 255 characters at most
- Shown when:
resourceis one offile - Expressions:
{{ }}accepted
Outputs
main— Taken once the Salesforce call has succeeded, whatever the operation. An error answer from Salesforce fails the step instead.
Data produced
What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).
{{ data.<step>.id }}—string. Create, Update, Get: the Salesforce ID of the record.{{ data.<step>.object }}—string. The Salesforce object (Lead,Contact,Account,Opportunity,Task,Note).{{ data.<step>.record }}—object. Get: the record, fields keyed by API name ({{ data.<step>.record.Email }}).{{ data.<step>.records }}—array of object. Search, SOQL query: the records found.{{ data.<step>.first }}—object. Search, SOQL query: the first record found, ornull.{{ data.<step>.found }}—boolean. Search, SOQL query:truewhen at least one record is found.{{ data.<step>.count }}—number. Search, SOQL query: the number of records returned.{{ data.<step>.contentVersionId }}—string. Attach a file: the ID of the createdContentVersion.
Example
An agency receives viewing requests by email. To create a lead for each request:
resource lead
operation create
values LastName = {{ data.extract.name }}
Company = {{ data.extract.company }}
Email = {{ email.from.email }}
LeadSource = EmailPut a Salesforce Search node before it (resource contact, searchTerm {{ email.from.email }}) and a Condition on {{ data.<step>.found }} so that no lead is created when the sender is already a contact.
Tips
- Required fields. Lead:
LastNameandCompany. Contact:LastName. Account:Name. Opportunity:Name,StageName,CloseDate(YYYY-MM-DD). Note:ParentIdandTitle. Missing ones fail the step before any call. - Search. Lead and contact: by exact email address. Account and opportunity: by part of the name. Task: by subject. Note: by title. At most 200 results, most recent first.
- SOQL query. A read starting with
SELECT. A value coming from an email must be quoted and contain no apostrophe: prefer Search, which escapes the value. - Attach a file. The file is published on the record (Files tab), 10 MB at most.
- Test runs. In a test run, reads are real and writes are described without being done.
- Permissions. The node has the permissions of the user who connected Salesforce.