Visitor Group criteria for Episerver Forms
Jan 11, 2016
Episerver Forms is a new add-on that vastly improves the form capabilities over the legacy xforms implementation. However (at the time of writing) Episerver forms does not come with a set of visitor group criterion that will allow editors to personalise a user’s experience based on their interactions with forms on the site.
I wanted to add a set of Visitor Group criteria that can be used with new Episerver Forms. This post also helped me to explore the Episerver Forms API a little more too!
This checks the cookie that's dropped when a form is submitted to see if a user has submitted a form.
Form value criteria
This checks for submitted form values in the current session (using the configured session state provider). This allows editors to progressively profile end users as they take a journey on the site.
A couple of notes on the functionality of criteria:
- If a user is allowed to submit the form more than once then the most recent submission is used
- The current version lists all forms and all properties in a single drop down list. Future versions could separate drop downs where a form is selected first then the form field
- Currently only string comparisons on form values can be checked
The Form value criteria uses an Episerver initialization module to listen out for form submissions for a user and will allow editors to create visitor groups.
I toyed with the idea of using a cookie but wanted to get some feedback on this idea before continuing.
The code is available on Github and the can be installed from the Episerver Nuget feed. It should be noted that your solution requires .net 4.5.2 to install!
Episerver Forms are still in beta and there is more development to come so but in the meantime I hope that you find these criteria useful. I’d be happy to hear feedback in the comments below or on @davidknipe