Guide | Kentico

Creating Dynamic Smart Forms In Kentico EMS

We take a deeper look into using Kentico EMS forms for intelligent data capture, no coding required!

18 May 2016 ( words)
Henry France Henry France

We’re always finding something new we can do with Kentico EMS.

I love to help our clients get more out of Kentico EMS. It’s such a powerful piece of software, and we’re always finding something new we can do with it.

Dynamic forms have been a feature of Kentico for a long time, since 2012 actually, but most users tend to only scratch the surface with what’s possible.

Consider this simple business-to-consumer (B2C) example…

Imagine we have a single contact form with a ‘Nature of Enquiry’ field – a dropdown list containing the different types of enquiry we are likely to receive.

Depending on the type of enquiry, we might need additional information – but we don’t want to ask those questions every time. For example, one of the options might be ‘Warranty request’, in which case we need to ask them for their ‘Product Code’ so we can check they have a valid warranty.

Simple dynamic form

In Kentico, this is very easy to achieve using the following configuration:

Simple dynamic form configuration

So now, we only show this question if it’s appropriate to do so.

But that’s only where the fun stuff begins...

For Kentico EMS users, we really want to make use of the Contact Management aspects of the system so that we can build up a more complete picture of our visitors. Then we can begin to personalise their online experience to increase conversion and use marketing automation to really engage with them.

Consider this common business-to-business (B2B) example…

Imagine we offer a range of white papers, many of which provide very high-value content - before downloading, we'd like to capture some visitor information.

There’s a lot we’d like to know about the visitor, but the last thing we should do is ask them too many questions and risk them abandoning the form altogether. Instead, we’ll leverage Kentico EMS’s macro engine to help us tailor the forms based on the information we already know and what we’d like to find out.

A working example

Here’s a form the first time a visitor submits it…

And here is the ‘smart form’ the next time the form is displayed…

See how we’re pre-populating the information we have already, and changing the questions we’re asking? Not only are we saving the visitor from re-typing their information, but we’re also filling in the gaps in our CRM to capture more important data.

Here’s how to do it…

NB. You need Kentico EMS to achieve this (please get in touch if you'd like a demonstration).

Step 1 - Customise the Contact

Firstly, you’ll need to customise the contact record slightly to accommodate the additional fields you’d like to capture.

To do this, navigate to Modules > Contact management > Classes and then edit the Contact management – Contact class.

Open the Fields tab, and then click on New Field with the following information (obviously customise this to your own requirements):

Field name: ContactCompanyIndustry
Data type: Text
Field size: 200
Field caption: Company industry

Click Save, and then click New Field again and enter:

Field name: ContactCompanyMarketingBudget
Data type: Integer number
Field caption: Company marketing budget

Click Save once more.

Now navigate to the Contact management application, and open an individual Contact, you should see these new fields displaying in the Custom fields tab.

Step 2 - Create a lead capture form

Now we proceed to creating our lead capture / download form. You can read how to create a form and add fields to the form in the Kentico documentation.

Click New field, and enter the following:

Field name: FirstName
Data type: Text
Size: 200
Required: true
Default value: (click on the arrow, and then enter)
{ %OnlineMarketingContext.CurrentContact.ContactFirstName% }
Field caption: First name
Form control: Drop-down list

Click Save and then New field, and enter the following:

Field name: LastName
Data type: Text
Size: 200
Required: true
Default value: (click on the arrow, and then enter)
{ %OnlineMarketingContext.CurrentContact.ContactLastName% }
Field caption: Last name

Click Save and then New field, and enter the following:

Field name: Email
Data type: Text
Size: 200
Required: true
Default value: { % OnlineMarketingContext.CurrentContact.ContactEmail % }
Field caption: Email address

Click Save and then New field, and enter the following:

Field name: CompanyName
Data type: Text
Size: 200
Required: true
Default value: { %OnlineMarketingContext.CurrentContact.ContactCompanyName% }
Field caption: Company name

Click Save and then New field, and enter the following:

Field name: CompanyIndustry
Data type: Text
Size: 200
Required: true
Field caption: Industry
Form control: Drop-down list
Data source: select ‘List of options’ and enter the following into the box (each on a new line)

;Please choose
Aerospace
Construction
Finance
Healthcare
Telecommunications

Visibility condition (this is the important bit!):
{ %OnlineMarketingContext.CurrentContact.ContactCompanyIndustry==null% }

Click Save and then New field, and enter the following:

Field name: CompanyMarketingBudget
Data type: Integer
Required: true
Field caption: Monthly marketing budget
Form control: Drop-down list
Data source: select ‘List of options’ and enter the following into the box (each on a new line)

;Please choose
5000;Under £5,000
10000;Under £10,000
25000;Under £25,000
50000;Under £50,000
100000;Under £100,000
100001;Over £100,000

Visibility condition (this is the important bit!):
{ %OnlineMarketingContext.CurrentContact.ContactCompanyIndustry!=null && ToInt(OnlineMarketingContext.CurrentContact.ContactCompanyMarketingBudget,0)<=0 % }

Click Save.

Click on the Contact mapping tab and ensure you correctly map your fields to the contact attributesImportantly, remember to map these new custom fields to your new custom fields in your contact.

You can continue to customise the form layout, email notifications, auto-responder and so on, but for the purposes of this article we’ll continue without doing so.

Step 3 - Embed the form

Now we’re ready to put the form on our pages.

You can find more instruction on how to add forms to your website here.

Once that’s done, it’s time to test things out… enjoy!

The additional data you are now collecting can be used to create contact groups and personas, to personalise website content, and be integrated back into your CRM through marketing automation tasks.

If you have any questions, pop a message below and we’ll do our best to help you.

Henry France

Author: Henry France