Create Visit Records and Track Number of Visits

In this guide, we will demonstrate how to create Site visit records with Formyoula mobile forms that are linked to an existing or newly created Contact record. The number of times visited also will be captured by the form.

1. Create a custom object in Salesforce called “Visit”.

image
image

2. Create a custom Master-Detail Relationship field for the Visit object that is related to the Contact object.

image
image

3. Create a Roll-Up Summary field on the Contact object.

image
image

4. Select the Visit object from the Summarized Object list. This will ensure to count how many times the client has visited.

image

5. Select “Count” from the available options. This will ensure that the field will count and add times based on how many times the client has visited.

image

6. Next create a Formyoula form with all the fields necessary for Contact record creation. Add the Salesforce Lookup element for the Contact object in case the Contact already exists in Salesforce and is visiting repeatedly.

image

7. Next we will add two Salesforce connections. First for the Contact object and second for the custom Visit object.

Click on “(Add)” under the “Connections” column or click on the “Create a Connection” button, or select “Add/Edit Connections” from the “Actions” available list.

image

8. Select “Salesforce” from the available connections list and click “Create Connection >>”.

image

9. Select “Contact” from the available Salesforce Object list and click “Save”.

image

10. Set the “Insert Sequence” as “1”. This will ensure to create the new Contact record prior to the new Visit record.

image

11. Select your lookup field from the list to ensure that Visit records will be created and counted if the Contact is visiting repeatedly. In this case, we named the lookup field “Find Contact”.

image

12. Click “Save Record Settings” when done.

image

13. Map all the necessary fields for your Contact record.

image

14. When done, click on the “<< Back to Connections” button.

image

15. Select “Salesforce” from the available connections list and click “Create Connection >>”.

image

16. Select “Visit” from the available Salesforce Object list and click “Save”

image

17. Set the “Insert Sequence” as “2”. This will ensure to create the Visit record after the Contact record is created or updated.

image

18. Click “Save Record Settings” when done.

image

19. Map the lookup field from your Formyoula form to the Master-Detail Relationship field. In this case, the field is called Contact (Contact__c). This will ensure to add the Visit record to an existing Contact record.

image

20. Map the [New Contact (Seq 1)] field to the Master-Detail Relationship field. In this case, the field is called Contact (Contact__c). This will ensure to add the Visit record to the newly created Contact record.

image

21. When done, go to your Formyoula dashboard.

image

22. Click on the “Try” button next to the form. This will open the mobile web app.

image

23. Select the newly created form.

image

24. First we will use the option to create a new Contact record if the client is visiting for the first time. Capture the details and submit the form.

image

25. Now in Salesforce you will be able to see the newly created Contact record as well as the new Visit record and the number of times visited.

image
image

26. Next we will use the option to find the Contact record via the Salesforce lookup field if the client is visiting repeatedly. If found - leave the rest of the fields empty and submit the form.

image

27. Now in Salesforce you will be able to see the existing Contact record updated with an extra Visit record and the number of times visited will be automatically increased to 2.

image
image

For any questions please contact us - [email protected].