The Salesforce add-on lets you push new records to objects using an action and create new forms from your Salesforce objects in a single click on the add form page.
An example use of this add-on would be to add sales inquiries as Leads in Salesforce.
Installation
The Salesforce plugin is installed in the same way as installing the WS Form PRO plugin.
Once installed you will need to activate the license for the plugin. When you purchase the Salesforce plugin, you will be given a license key. If you have lost your license key(s), click here.
To activate your license key:
- Click WS Form in the WordPress administration menu.
- Click Settings.
- Click the Salesforce tab at the top of the page.
- Enter your license key.
- Click the Activate button.
If your license key fails to activate, please ensure you are using the correct license key and not your WS Form PRO license key.
Connecting to Salesforce
In order to use the add-on, you need to connect it to Salesforce. Connecting is easy!
- Click WS Form in the WordPress administration menu.
- Click Settings.
- Click the Salesforce tab at the top of the page.
- Optional – Enter a custom API endpoint hostname (e.g. test.salesforce.com). This defaults to login.salesforce.com which connects you to the production salesforce environment.
- Click Connect and follow the onscreen prompts
If you do not have a Salesforce account, you can create a new account here.
Working Objects
Because of the number of objects in Salesforce, you select the objects you want to work with on the settings page. Custom objects you create in Salesforce are also included in this list. When the plugin is first installed, we select the most common objects for you such as Leads, Contacts and Accounts.
To add or change the objects you want to work with, choose the objects from the select list on the Salesforce settings page.
To select more than one object:
- On a Mac, hold the Command key and click the object names
- On a PC, hold the CTRL key and click the object names
Click Save after you have made any changes.
Creating a Form for Salesforce
Automatically
WS Form can create a form for any of your Salesforce objects in a single click. This process not only creates a form but also fully configures WS Form so that the form is ready to use immediately.
To create a Salesforce form in WS Form:
- Click WS Form in the WordPress administration menu.
- Click Add New.
- Select the Salesforce tab at the top of the page.
- Click on any of your working Salesforce objects.
- Wait a few moments while the form is created.
That’s it! Your form will be created and is ready to add to your website.
If your object does not appear, click the refresh icon in the Salesforce tab.
Manually
It is also possible to use any form created in WS Form and add an action so that it is submitted to a Salesforce object when a user saves or submits their form.
To add a Salesforce action:
- When editing your form, click the Actions icon at the top of the page. The Actions sidebar will open on the right-hand side of the page.
- Click the Add icon to add a new action.
- Select Add to Salesforce from the Action pulldown. A series of settings will appear.
As with all sidebars in WS Form, click to the Save button at the bottom to save your changes, or click Cancel to disregard your changes.
The Salesforce action settings are as follows:
When Should This Action Run?
You can choose to run the Salesforce action when the form is saved, submitted, or both.
Salesforce Object
Select the working Salesforce object you would like to push data to.
Opt-In Field
Use this setting to select which of your fields to act as the opt-in field. We recommend adding a checkbox field with a single checkbox. It is always recommended that you have an unchecked opt-in checkbox on your forms to ensure you comply with GDPR requirements.
Field Mapping
Field mapping tells WS Form which of your form fields relate to the corresponding fields in Salesforce. For example you would want to map your Email field to the Email field in Salesforce.
To map a field:
- Click the Add icon at the bottom right of the field mapping section.
- In the left-hand column, select your form field.
- In the middle column, select the corresponding Salesforce field.
- In the right column, select the update method (See If Duplicate Found below)
- Repeat this process for each field on your form.
- Click the Save button at the bottom of the sidebar to save your changes.
Custom Mapping
Custom mapping allows you to set a Salesforce field to any value you wish, including the use of WS Form variables. For example you might want to map a lead source to the source field in the Lead object in Salesforce.
To add a custom mapping:
- Click the Add icon at the bottom right of the field mapping section.
- In the left-hand column, enter a value or a WS Form variable.
- In the middle column, select the corresponding Salesforce field.
- In the right column, select the update method (See If Duplicate Found below)
- Repeat this process for each field on your form.
- Click the Save button at the bottom of the sidebar to save your changes.
Find Duplicates By
The Salesforce add-on can detect duplicates by any of your object fields. When a duplicate is found, you can opt to either update the object using the newly submitted data, or do nothing. Use this setting to choose which Salesforce field to deduplicate by. This field must be mapped in order for deduplication to work correctly.
If Duplicate Found
If a duplicate record is found, it will carry out the method selected here.
If Update is selected, WS Form will follow the On Update rules specified in your field and custom mappings.
- Update – Will update the record
- Merge – Will merge the existing and new value together (this is useful for Picklist Multi fields)
- Ignore – The field will not be updated
Attachment Mapping
File and signature fields can be mapped so that they are uploaded as attachments to the Salesforce object when it is added.
To add a file or signature field as an attachment to the object:
- Click the Add icon at the bottom right of the attachment mapping section.
- Select your form field.
- Repeat this process for each field on your form that you want to include as an attachment.
- Click the Save button at the bottom of the sidebar to save your changes.
File fields that are marked as multiple will result in multiple attachments if more than one file is uploaded.
Variables
When the add-on creates or finds a duplicate object, the object ID can be used in subsequent Salesforce actions by using the following variables:
Variable | Description |
---|---|
#salesforce_object_id |
ID of the last object created. |
#salesforce_object_id_first |
ID of the first object created. |
This means that you can associate other objects with a previously created object (e.g. an opportunity related to a contact).
Troubleshooting
If the connection between your website and Salesforce stops working, click Disconnect then Connect to reconnect. You should also check the Salesforce status page to see if there are any problems with their API / REST connections.
If any submissions to do not make it to Salesforce because of a technical error, you can resend them:
- Go to Submissions
- Find and view the submission that did not push to Salesforce
- Scroll down to the action section
- Click the Re-run action