Troubleshooting issues on saving forms in Sitecore Forms


Summary

This article provides troubleshooting scenarios for the following issues that might occur in the Sitecore Forms application:

Unable to save the form that contains multiple submit actions with the same name

Description

In Sitecore Forms, saving a form might fail with the following error if several submit actions that have the same name have been added to the submit button element:

Unable to save the form because it contains multiple fields with the name "Submit Button". The form was not saved.

A message similar to the following can be found in the logs:

ERROR [Experience Forms]: The item name "Trigger Goal" is already defined on this level.
Exception: Sitecore.Exceptions.DuplicateItemNameException
Message: The item name "Trigger Goal" is already defined on this level.
Source: Sitecore.Kernel
   at Sitecore.Data.Items.ItemUtil.AssertDuplicateItemName(Item destinationItem, Item sourceItem, String name)
   at Sitecore.Data.Items.ItemUtil.AssertItemName(Item destinationItem, Item sourceItem, String name)
   at Sitecore.Data.Items.Item.Add(String name, TemplateID templateID)
   at Sitecore.ExperienceForms.Mvc.Models.Fields.ButtonViewModel.AddItem(String itemName, Item destination, TemplateID templateId)
   at Sitecore.ExperienceForms.Mvc.Models.Fields.ButtonViewModel.UpdateSubmitActionDefinitions(Item item)
   at Sitecore.ExperienceForms.Mvc.Models.Fields.ButtonViewModel.UpdateItemFields(Item item)
   at Sitecore.ExperienceForms.Mvc.Models.Fields.FieldViewModel.UpdateItem(Item item)
   at Sitecore.ExperienceForms.Client.Pipelines.SaveForm.UpdateItems.EditModelProperties(ViewModelWrapper viewModelWrapper, Item item)
   at Sitecore.ExperienceForms.Client.Pipelines.SaveForm.UpdateItems.SaveModel(ViewModelWrapper viewModelWrapper, SaveFormEventArgs args, ICollection`1 deleteList)

Solution

To resolve the issue, consider one of the following options:

Unable to save the form that contains multiple elements with the same name

Description

In Sitecore Forms, saving a form might fail with one of the following errors if several elements that have the same name have been added to the form:

Unable to save the form because it contains multiple fields with the name "Single-Line Text". The form was not saved.

or

Failed to create an item with id {Item ID}. The form was not saved.

Solution

To resolve the issue, consider one of the following options: