Conditional Salesforce Record Creation

To start, please go to your Formyoula Dashboard - https://app.formyoula.com/dashboard and click "New Form".

image

Rename your form, we will call our form "Weekly Class".

image

Add at least one page to your form. We will add one called "Class Details" and click the "+" button to create it.

image

Drag and drop a Salesforce Lookup field on your form. We will use the Event object on Salesforce to record our class attendance and link this to an existing Contact record.

image

Click the pencil icon to edit the Salesforce lookup field.

image

Select an object you would like to use for the lookup, this will allow you to search for any record under this object. In our case we will name the Label as Contact and will link it to the Contact object.

image

Now drag and drop a "CheckBox" field. We will use this to create a new Contact if the Contact was not found via the lookup. Click the pencil button and rename the field. This field will be used to control the new Contact field visibility on the form.

image

Drag and drop a "Text Field", rename as "First Name". Press "Add Controlling Field" under "Controlling Field" select "Create New Contact?" and under "Show If" select "Yes" then press "Add".

image
image

Drag and drop another "Text Field", rename as "Last Name". Press "Add Controlling Field" under "Controlling Field" select "Create New Contact?" and under "Show If" select "Yes" then press "Add".

image
image

Drag and drop a "Header" field, we will rename it as "Class Information".

image

Drag and drop a "Text Field", we will rename it as "Class Name".

image

Drag and drop two "DateTime" fields. Rename one for "Start Date&Time" and second for "End Date&Time".

image

When finished, click the "Save & Close" button.

image

Now we will need to add two Salesforce connections, one for the Contact record that will be created if existing is not found via the Salesforce lookup and the second one for the new Event record that will be linked with the new or existing Contact. Click "Add" under the connection column.

image

Select Salesforce from the available connections list and click "Create Connection".

image

First, we will create a "Contact" connection to create a Contact record when a form entry is captured, and existing Contact is not found. Select "Contact" from the "Salesforce Object" list and click "Save".

image

The Contact connection "Insert Sequence" will need to be "1", this will ensure that the Contact is made prior to the Event.

image

Select "Contact" under "Skip If?" this will ensure that new Contact will not be created if it already exists and was found using the Contact lookup on the form.

image

Click "Save" when done.

image

On the first connection we will map our Contact's "First Name" and "Last Name" to create a new Contact on Salesforce if the Contact was not found via the lookup.

image
image

Check if the mappings are correct.

image

When mapping is done click "Back to Connections" button to make second connection.

image

Select Salesforce from the available connections list and click "Create Connection".

image

On the second connection we will create an Event on Salesforce that will be populated with the Class Details.

image

First, update the "Insert Sequence" to "2", so that the Event record is created after the Contact record.

image

Click "Save" when done.

image

Map the Formyoula "Contact" field to the Salesforce "Contact/Lead ID (WhoId)".

image

Map Formyoula [New Contact (Seq. 1)] field to the Salesforce "Contact/Lead ID (WhoId)" field.

image

Map the Formyoula "Class Name" field to the Salesforce "Subject" field.

image

Map the Formyoula "Start Date&Time" field to the Salesforce "Start Date Time" field.

image

Map the Formyoula "End Date&Time" field to the Salesforce "End Date Time" field.

image

Check if the mappings are correct.

image

Go back to the Formyoula Dashboard when done.

image

On the Formyoula Dashboard, click the "Try" button to launch the Mobile Web App.

image

Select the newly created form.

image

Use the Salesforce Lookup Object to search for Contacts.

image
image

Tick the "CheckBox" to create a new Contact if Contact was not found via the lookup.

image

Press "Submit" when it is completed.

image

Now when you open Salesforce you will be able to find the Event for an existing Contact under the "Activities", or you will be able to find the newly created Contact with the Event under the "Activities".