How to map Episerver custom form field with MAI



Episerver forms add-on together with inbuild field types represent very good foundation to interact with visitors. You will find a need for custom form field after some time or little bit advanced use case. There has been many useful articles how to make a custom form field. Here are a few of them:

I have found having  consent form field like very useful in many cases.  As you (probably) know produce checkbox with text on the right is very straightforward operation by using "Multiply or single choice" form field. However, this field type does not allow full (HTML) text thus having an url in the text beside a checkbox  is mission impossible.

Consent field in its core contains of checkbox and rich-text  field.

My point here is to focus on make custom form field ready for data mapping while utilizing Episerver Marketing Automation package.

Prerequisites, of course, are to install Salesforce add-on n as described on link

Form field data

Form field Model

Notice that model class implements IUIExternalFieldMapping available in EPiServer.Forms.EditView. This will add additional tab to map form field value with marketing automation platform.

Form Field View

Note: Views, by default, are located in ~/Views/Shared/ElementBlocks. This can be changed in forms config file or via source code.  More information about configuration is available on


Source code

The whole solution is available on github.


Episerver forms are very easy to extend and accommodate your project needs whether you stay in CMS itself or want to share form submission values with other applications.