When a potential customer fills in the Web to Lead form, you may want to tag the contact as sourced from this form.
This article covers customizing the Web to Lead form to add an existing tag to all contacts who fill in the form.
NOTE: This video assumes a beginner knowledge of Method customization.
1. Create the Tag
Before Method can add a tag to an existing client, this tag must exist first.
Open up any contact in the Contacts app.
Edit the contact.
On the right, type your tag into the Tags field. The dropdown will show you the New Tag. Click it to add the tag. In the below image, we are adding the new tag "
W2L
".Once this tag is added, you don't need to save the contact. In fact, remove the tag from the contact, since it was only added to create it.
Step 2. Find the Web to Lead form
Before customizing the Web to Lead form, you need to find where to customize it.
Open up the Web to Lead App.
Select the Web to Lead form you want to customize.
Scroll to the bottom of the screen and click the Preview button.
From here, Customize the screen.
The page is Published, so click Edit to create a draft version.
Now we're ready to customize this screen.
Step 3. Customize the Web to Lead form
Normally, you'd need to find which control has the actions to add a customer, and you can do that by going to the Submit button and following the Call Routine action from there.
However, for this article, we know where it is, so we'll go straight from there.
NOTE: The tag will only be added to contacts that do no exist. Any existing contact will not have a tag added to it.
Scroll down and find the section called SectionCode. In it, you will find the CreateCustomer object. Expand it and go into its Click event.
Scroll down in the action list until you find the 23rd action: Retrieve Values From Table. There are a number of things to understand about what is happening here:
You are not updating the Retrieve Values From Table action.
There is no action that updates the contact. There are only actions to update the Customer, so we will need to add an action to update the contact.
A contact is automatically added when a customer is created. In order for us to update the contact, we will need its Record ID. This Retrieve Values From Table action places the contact record ID on the screen: in the control ContactRecordIDPlaceholder.
This action is within the Else statement and we need to make sure the next action we added is below it and also within the Else statement.
On the Retrieve Values From Table action, click the Add action plus icon [
β
] so it adds the next action right below it and within the Else statement.Add the action Update Fields in Table. Note the indentation. It is embedded within the Else statement.
For the table, select the
Contacts
table.Click Open criteria builder and add the criteria:
RecordID
Is Equal
ContactRecordIDPlaceholder
Go Back and add in
Field(s) to update: Taglist
Update using this value:
Type: Text
Textbox: "
W2L
"
Add an Internal Note, then Close the action list.
And your customization is done!
Before publishing your new draft version as the live version, test out filling in this form. Your new contact will have the tag added.