A poll with Sitecore Forms

Created: 3 Aug 2021, last update: 30 Jan 2022

A poll with Sitecore Forms #2

In Getting data programmatically out Sitecore Forms, I have already explained how you could access the submitted form data. To complete the story I created a demo see https://github.com/jbluemink/Poll-Sitecore-Forms

Instead of storing the value In the Form Database you can also store the value in the xDB profile, then you can use the value to personalize. See https://doc.sitecore.com/en/developers/101/sitecore-experience-platform/create-a-custom-model.html
First, create an xDB facet where you can store the value, and optional add it to the Experience profile, this can be easily done with EPExpress Tab.

See https://doc.sitecore.com/en/developers/101/sitecore-experience-manager/walkthrough--creating-a-custom-submit-action-that-updates-contact-details.html How to create a Save Action. For the demo, I also created a custom save action “Update Car Color” which stores the value in xDB.

If you want to prevent the user from submitting multi times the poll, you can use personalization to hide the poll and show the result. Therefore, you can use Goals. Or create a personalization rule. This demo contains 2 rules. To personalize on filled in Car color or not, or personalize on the value.


To see the values easy in the XP profile it is handy to register the user and give a Name, this can be easy done with Sitecore Forms Extensions and the xDB ValueProvider from https://github.com/bartverdonck/Sitecore-Forms-Extensions This way you can easy create a form with fields that are pre filled with the values stored in XB and they are also stored in xDB, When filling in a name, it is easier to find the user in the xDB profile.Don't forget the Store Binding value.