Understanding Forms in Sitecore XM Cloud

Hello everyone!! In this blog we are going to see how we can create Forms in XM Cloud using Forms feature recently introduced. we will create an webhook submit action to show the posted data.

We will create a sample form in XM Cloud. Follow the screenshot below as most of the things will be. I will add the notes whereever its required.

Select Form from Tools tab.

Create Form and Save

Form Builder

We need to select a layout. Select Full width layout from Layout tab and drag it to page. After that navigate to Items tab which will have fields that can be drag and drop to layout to create the form.

Form Builder

Drag and Drop Short Text field for Full Name and Email. Select the Individual Fields. You will get lot of properties for that selected field. Modify according to one's need. Refer below screenshot for your reference.

Navigate to Settings tab in Form Builder. We will configure thank you message,error message, webhook actions.

Webhook is basically an HTTP REST endpoint which accept data. It can be anything like Azure function, Rest controller etc. There are many free site which provide a free HTTP endpoint for testing purpose.I have also used on free webhook endpoint.

Before proceeding, we will first configure a webhook submit action which will get the submitted form data. Click on Mangage Webhook in Settings tab. It will take you to adding webhook page. Add one and save it. Follow below screenshot for your reference.

Navigate back to Settings tab: Choose webhook from dropdown. choose the submit action as shown below.

Navigate to Preview tab in form builder: Here you can check your form how it is looking and from here you can test the form.

Make your form active before testing the form: Your newly build form will be in inactive state. Click the ... symbol in right corner and activate your form.

Click your newly created Form: Navigate to preview tab and you can test your form there.See below screenshot for your reference.

Webhook Before Form submission.

Form submission successfully tested with webhooks

Webhook After Form submission.: You can check the same payload what you sent from your forms in webhook.

As this blog has became too lenghthy, but it might have given a brief overview of Forms feature in XM Cloud.Thanks for reading and keep learning!!

You can check my other blogs too if interested. Blog Website

Comments

Popular posts from this blog

Sitecore XM Cloud Form Integration with Azure Function as Webhook

Automate RSS Feed to Sitecore XM Cloud: Logic App, Next.js API & Authoring API Integration

Create and Fetch Content From Sitecore Content Hub One using GraphQL and React