In this tutorial we will create a contact us form that creates a new record in Salesforce, or updates an existing record if it already exists.

Create a new form

On your FormCrafts dashboard click on New Form. This will open a popup dialog where you can choose to start from a scratch, select a template, or duplicate an existing form. For this tutorial we would select Blank Form. On the next screen enter the form name and press Enter.

We now have to add fields to our form. Using the Add Field button on the top-right corner of the screen add the following fields to your form:

  1. A one line input field. Label this one What is your first name?
  2. Another one line input field. Label this one What is your last name?
  3. An email field. Label this one What is your email?
  4. A commend field. Label this one Any comments?

At this point our form would look like this:

Salesforce update contact form
Salesforce update contact form

Connect to Salesforce

Next click on the Salesforce icon on the top-left corner of the screen, and click on Connect. This will open a popup where you can authorize your Salesforce account.

Connecting to Salesforce
Connecting to Salesforce

Map fields

Now click on the Records tab. Here click on Add Action. There are 4 different ways to configure record manipulation:

  1. Create
    This always creates a new record
  2. Create if
    This creates a new record if the lookup succeeds
  3. Create or Update
    This updates the record if lookup succeeds, or creates a new one if lookup fails
  4. Update if
    This updates the record if lookup succeeds
  5. Lookup
    This simply tries to find a record. This method does not manipulate the record, but we can use the lookup reference when working with other actions.

Now, click on Create and select Create or Update instead. Where it says (select object) pick Contact. Effective our action is: create or update a contact in Salesforce when someone submits the form.

For update to work we need to first have a set of lookup conditions. For this form we can have one simple lookup condition: the email needs to match. Create a lookup condition: Email is What is your email?

Next we have to map our form fields to their respective Salesforce counterpart.

Click on (select) and select the What is your first name? field. Next click on (Salesforce field) and select First Name. Now click on Add. We will map the other form fields in this manner. Our field mapping should then look like this:

Salesforce update contact form field mappings
Salesforce update contact form field mappings

That was the last step. You can now click on Preview (top-right corner) and fill out the form and hit submit. This will create a new contact or update an existing one in your Salesforce account in real-time.