Help Centre › Functions & Formulas
This article describes the RPA Salesforce connector function to create a new record.
For a full list of available functions, please read SALESFORCE functions.
Description
The Create record function creates a new sObject record in Salesforce. Specify the sObject type (e.g. Account, Contact, Lead) and provide field values as additional parameters. The created record’s ID is returned.
Setting it up
{{popups:rpas/add:action=salesforce-create-record}}
Once on a process map:
- Navigate to the process where you would like to add the function
- Click on the green button’s drop-down (right side of the green button labelled “Process”)
- On the menu that appears, click on the “+ Activity” item
- From here you can select the SALESFORCE Create record option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Connector | Yes | Select | - | Select the Salesforce connector to use |
| sObject | Yes | Text | - | sObject type (e.g. Account, Contact, Lead, Opportunity) |
| Fields (JSON) | Yes | Textarea | - | JSON object of field values, e.g. {"Name":"{name}","Industry":"Technology"} |
| Variable | Yes | Text | - | Variable to store the result |
Output variables
| Variable | Type | Description |
|---|---|---|
| Variable | Object | Object with id (the new record ID), success (true/false), and errors array |
Errors
- REQUIRED_FIELD_MISSING – a required field was not provided
- INVALID_FIELD – a field name does not exist on the sObject
- DUPLICATE_VALUE – a unique field value already exists
Tips
- Use Describe sObject to discover required fields before creating records
- Use variables in JSON values: {"Email":"{email}","LastName":"{last_name}"}
- Access the new record ID via {variable.id}
Related functions
- Update record – Update an existing record
- Get record – Retrieve a record by ID
- SOQL query – Query records