Posts

Showing posts from July, 2024

Creating custom value providers in Sitecore Forms

Image
  Creating custom value providers in Sitecore Forms   In this blog we will see how we can use the Custom Value providers in Sitecore Forms. Basically, I will be creating a custom value provider which can be used to pre-fill the field(s) in the Sitecore Form. Actual Use Case:   Suppose you have created a News Subscriber Form, in which a Logged in user can subscribe for newsletters from you company. In that form, you wanted to pre-fill the Firstname and Lastname fields so that user can see their details (although can change the values as well) prior submitting the request. To re-fill or populate the fields, we can create our own custom value provider which will return the value based on parameter value set for that particular field. In short, while loading the Sitecore form, the request will attach to backend code, from which you can return the user model values fetched from XConnect or any other API or database table directly to the form field. To understand it better, let...