Tailwind Logo

Introduction to Sitecore Forms

XM Cloud

Published: 2024-07-26

Sitecore Forms, a form tool provided by Sitecore XM Cloud, is introduced in this article.

What is Sitecore Forms?

There are many requests related to forms when running a website. For this part, Sitecore Forms is provided as a tool that works with Sitecore XM Cloud. In this article, we will use Sitecore Forms to create forms.

When you first access the site, it is empty with regard to forms, as follows.

formsintro01.png

Create a new form

From the above screen, click on the button Create form. A dialog box will appear in which you can enter a name for the form.

formsintro02.png

When you create a new form, you switch to the design screen as shown below.

formsintro03.png

When an empty form is created, no layout is provided. Click on 2 x 1/2 as layout on the right-hand side of the screen to split the form in two, left and right.

formsintro04.png

An error is displayed at this stage. This is displayed because the Action Button has not yet been placed in this form.

In this case, we want to place a form in the right-hand area. Click on the + button and you will see the items you can place as follows.

formsintro05.png

The following components are available for different types of items

  • Button
  • Email
  • Phone
  • Short text
  • Long text
  • Select
  • Multi Select
  • Date
  • Number
  • Radio button
  • Checkbox
  • Checkbox Group
  • T&C Checkbox
  • reCAPTCHA
  • File upload

Other items than those on the form above are also available.

  • Image
  • Text
  • Spacer
  • Social media

In this case, we select Text because we want to create a simple request form. We have placed a simple text as the content.

formsintro06.png

Next, place the Single Text as an input item. When adding an item, you can also drag and drop it from the list of items on the left-hand side.

formsintro07.gif

In this case, the following settings have been made to ask the user to enter their name.

formsintro08.png

Then use the Email section to place the items as follows.

formsintro09.png

Note that both name and email address are required fields.

formsintro10.png

Finally, place the Submit button.

formsintro11.png

Place the image on the left-hand side.

Now that you have lined up all the form items on the right-hand side, this time you want to place the image on the right-hand side.

formsintro12.png

As you have not yet selected an image, click to upload the image file.

formsintro13.png

Run preview.

To check the behaviour of the form you are creating, switch to preview mode and see how the form behaves.

formsintro14.gif

We have confirmed that the screen is adequate on mobile.

Save

Save the created form. There are four options for saving.

formsintro15.png
  • Save and exit
  • Save and activate
  • Save a version
  • Save as template

This time, select Save and exit to finish editing. You will see that the form you created has been saved as a draft in the Forms list.

formsintro16.png

Summary

In this article, we introduced the procedure for creating a simple form. For the Sitecore Forms we have created, we need a webhook to work externally for data processing. We will introduce this in the form of a sample at a later date.

Tags