Continuing on from the first part of how to get your form submission data into a Salesforce custom object we will further explore how you can use this contact form data inside Salesforce to better help your organisation make informed business decisions based on the data.
Implementation time: 2 hours
Count of form submissions
How it is useful
This might sound basic, but there are times when you might want to see exactly how many forms each Lead/Contact submitted a form. If you’re running a website that has many different forms, often you will see the same Lead/Contact submitting multiple forms before finally converting.
Once the data is computed, you can then run standard Salesforce reports to calculate averages of how many times your segmented users submit forms before converting.
How to implement
For this we will use a free Salesforce app called Declarative Lookup Rollup Summaries Tool. This tool is required as there is no master-detail relationship between the two objects allowing us to create a roll up summary field.
I will not going into details about how to use this tool as it’s already well documented. Below will be a screenshot example which can be used as a guide.
- Create a new Number field on your Lead/Contact called Total Form Submissions (api name “Total_Form_Submissions__c”).
- Open the Declarative lookup rollup summaries tool and create a new rollup. In our case we are filtering based on the RecordTypeID. If you are only use a single record type for your form submissions you can leave this field blank.
- Save and deploy the trigger for Declarative lookup rollup summaries to work on your custom object.
- To update existing records you should click the “Calculate” button to calculate the job.
If everything is working you should be able to open a contact that has related form submissions and see the count.
Last form submission date
How it is useful
If you’re a large organisation with a lot of leads coming in every day, then you want to know when the last time was someone submitted a form. The problem is generally the created date of a contact. While you can sort leads by who was created first, with the last form submission date you can filter different list views to see if any of your old leads have re-surfaced to submit another form.
For example: Customer A’s first touch point is when he starts a trial of your software. Nothing happens to this customer for 12+ months and then he comes back to request an eBook on your website. After requesting the eBook, his last touch point is TODAY, boosting him right to the top of your list of hot leads. Time to call this customer and close the deal!
Example below shows a few variables which we use to see when a lead last touched our website or submitted a form.
How to implement
To implement this we will be using a combination of Salesforce Process Builder and a headless Flow to pull the last form submission time each time a new Online Actions record is created.
NOTE: this part is used in conjunction with declarative lookup rollup summaries above – each time the record is modified to reflect a new ‘total form submission count’ process builder will run the flow.
NOTE: You can do this with process builder only if you desire. When a form submission is created, simply run a flow to update your newly created field. This can have some bugs if you modify records which are older as it’s not checking all form submissions, only the last one which was created.
Create the Contact/Lead field
- Create a new DateTime field on your Contact/Lead called Last form submission (Api name: Last_form_submission__c)
Create the Flow
- Navigate to Setup > Create > Workflows & Approvals > Flows.
- Click to create a new Flow
Create a new Lookup element to search for any contacts which are equal to your contactID. Sort this by Descending so you will pull the last record only.
We use the NULL variable to ensure that the last contact date has a value, otherwise the flow could throw an error.
The variable var_ContactID should be set to “Input Only”. This is so later process builder can be used to populate the ContactID from the contact which was just updated.
Create a new decision to check if the DateTime field of your form submission date is “NULL”
Create a record update element to update the contact/lead with the DateTime of the last form submission.
Connect everything together and set the lookup element as the flow start point (the green arrow). Save your flow and activate.
Create the Process
The final step is to use Process Builder to execute every time a contact’s total form submissions field is updated.
- Navigate to Setup > Create > Workflows & Approvals > Process Builder
- Create a new process calling it whatever you like.
Select the Contact/Lead object which has the Last Form Submission field created in the first step. Ensure that it is set to run whenever a record is created or edited.
Create the criteria so the process will only run with the Total Form Submissions field is updated. Operator should be set to Is Changed > Boolean > True.
The final step is to then launch the flow created in the previous step. If you don’t see your flow, make sure you’ve activated it. Select the flow variable var_ContactID and set the reference to the [Contact].id.
The final process should look something like this.
Top forms being used
Because all of your form submission data is in one place, you can use Salesforce reports to slice and dice the data and find out what forms have been submitted the most.
Example below is a quick dashboard i threw together to show how many form submissions we were getting per week in total.
This is just the very beginning of what you can do with the newly acquired contact form data inside Salesforce. If you want to take your analytics one step further, you can even look at our article on using SalesWings to score leads and easily add a “Last Visit Time” to each one of your Leads/Contacts. Combined with the last form submission data and form submission count you can even further segment your Lead/Contact data.
These are just a few ideas but we would love to hear how you are also using contact form data inside Salesforce. Leave your comment below and let us know.