- Documentation
- User Application
- Integrations
- Apps and databases connector
Connect a template to Salesforce
A template works with Salesforce through connectors on its Integrations tab. Each connector uses one Salesforce connection of the project and one Salesforce object, and runs at a stage of the transaction: it fills form fields from a record when the transaction is created or while the client fills in the form, and writes to Salesforce when the form is submitted.
This page shows how the parts fit together, with an example. For every setting of the connector, see Salesforce connector and Connectors. To set up the connection itself, see Salesforce.
How a template is bound to Salesforce
Section titled “How a template is bound to Salesforce”| Part | Where you set it | What it decides |
|---|---|---|
| Connection | Reference of the connector | The Salesforce org. The list shows the Alias of each Salesforce connection of the project whose wizard is finished. |
| Stage | The card you add the connector in: PRESET, LIVE or SUBMIT | When the connector runs. See Stages. |
| Operation | Operation | Lookup in PRESET and LIVE. Create, Update, Delete or Upload files in SUBMIT. |
| Object | Salesforce Object | The Salesforce object, for example Account, Contact or a custom object. The list shows the objects that the Salesforce user of the connection can access. |
| Record | Query Conditions and What happens on query result | Which record the connector uses. A condition compares a field of the object with a form field, a label or a fixed value. Not used by Create. |
| Values | Field Mapping | Which values of the record fill which form fields, or which form values are written to which fields of the object. Not used by Delete. |
A template can have several Salesforce connectors, for example a lookup when the transaction is created and two SUBMIT connectors that update the record and upload the PDF. They can use different connections and objects.
Example: update an account
Section titled “Example: update an account”The client gets a form with the name and website of their account in Salesforce, corrects them and signs. When the client submits, Cellosign updates the account and uploads the signed PDF to it.
- In the template, add three Text fields with the IDs
AccountNumber(“Account ID”),AccountName(“Account name”) andWebsite(“Website”), and a Signature field. - On the Integrations tab, click Connectors, and add a PRESET connector that reads the account:
- Source: Salesforce. Reference: your connection. Salesforce Object: Account.
- Query Conditions: Id Equal the form field “Account ID”.
- What happens on query result: Case no match: Stop execution, add log error, with the message “Account not found”. Case match one record: Select record. Case more than one record: Select first record.
- Field Mapping: “Account name” from the DB Column Account Name, and “Website” from the DB Column Website.
- Add a SUBMIT connector that updates the account:
- Operation: Update. Salesforce Object: Account. The same query conditions and results.
- Field Mapping: the Column Account Name with Value Type Form field “Account name”, and the Column Website with the Form field “Website”.
- Add a SUBMIT connector that uploads the PDF:
- Operation: Upload files. Salesforce Object: Account. The same query conditions and results.
- Field Mapping: Value Type PDF result.
- Save the template.
Start the transaction with the account ID in the “Account ID” field: from a Salesforce flow, through the blueprint parameter of the field (see Start processes from Salesforce), or through API v3, as the initial value of AccountNumber. Instead of a form field, the condition can compare with a Label, a parameter that you send when you create the transaction, so that the ID isn’t shown in the form.
What Cellosign writes back
Section titled “What Cellosign writes back”In Salesforce
Section titled “In Salesforce”SUBMIT connectors run after the form is submitted, in the background. They work in Salesforce as the Salesforce user of the connection, so Salesforce shows this user as the one who made the change.
| Operation | What happens in Salesforce |
|---|---|
| Create | A new record of the object, with the mapped fields. |
| Update | The mapped fields of one record are changed: the record found by the query conditions, or the first or last one when the policy selects it. |
| Delete | One record, found in the same way, is deleted. |
| Upload files | The files are uploaded as Salesforce Files and linked to one record, found in the same way. PDF result is the signed PDF, Meta data is a metadata.json file with the form’s data, and Image and File are the files uploaded to that field of the form. |
When no record is found and the case is Skip, nothing is written, and the connector counts as successful.
In Cellosign
Section titled “In Cellosign”PRESET and LIVE connectors only fill form fields. For SUBMIT connectors, the transaction details on the Transactions screen show:
| Section | What it shows |
|---|---|
| Archive | Doc Number: the Salesforce reference, <object>/<record ID>, for example Account/001XXXXXXXXXXXXXXX. For Upload files, the IDs of the uploaded files follow it. Archive Status and Archive Failed Error show the result. With several SUBMIT connectors, the section shows the connector that ran last. |
| Integrations | Each connector call, with its status, the attempts left, the error and the time of the next attempt. |
Errors and retries
Section titled “Errors and retries”When a SUBMIT connector fails, for example because Salesforce refuses the values, the connection doesn’t work, or Stop execution, add log error applies, Cellosign tries again later. By default, it tries 5 more times, 10 minutes apart. When no attempts are left, the error report of the session is sent.
Salesforce usually refuses a record when:
- a required field of the object isn’t mapped (in Create);
- the Salesforce user of the connection may not edit the field or the object;
- a value doesn’t fit the field, for example a text in a number field, or a picklist value that isn’t in the list. See Data mapping and conversions;
- a validation rule of the object doesn’t pass.
The Error of the call in the Integrations section shows Salesforce’s message.
Changes in integrations
Section titled “Changes in integrations”A connector keeps the ID of its Salesforce connection. When you delete the connection, or import the template into a project or environment that doesn’t have this connection, the connector shows Connector not available. Click its pencil icon, select the Source and the Reference to use instead, and save. See Fix a connector.
The other Salesforce org may not have the same objects and fields, for example a sandbox with fields that aren’t yet in production. Open each Salesforce connector after the fix, and check its object, conditions and mapping.