Thursday, December 29, 2022

Deploy a custom Form Formatting as part of your Site Provisioning

 

Sometimes the default list "new Item"/Edit form is just not well suited as the number of fields causes the form to start scrolling and thus hiding some of the fields.




In the dark ages the default option was to use SharePoint Designer to modify the forms 😟, but today we have more choise based on your needs: 

  • Are you limited to only use out of the box SharePoint
  • Do you need to have logic in the form like if you entered option A in a field  then the options in the next field must be limited to a specific subset of options.
  • Should this list be provisioned to new Site Collections using a provisioning engine

If you need logic between the fields you will most likely choose to customize the list using PowerApps , however as far as I know is is not possible to deploy the PowerApp customization on multiple site collections.


If however you can do without the logic the most likely choice is to use Form Formatting  This will enable you to use the entire screen for your form and manage both the header, body and footer. The body can segregated into sections, making it easier for the end user to locate the fields:



        The PnP community maintains a repository of Form samples if you need some inspiration.



Once you have completed the Form customization it is time to extract it. The JSON configuration is a property on the Content Type, and the PnP sample provided by Kinga Kazala shows how to extract the JSON to a file.


Store the JSON file in SharePoint, setup an Azure Function as I have shown in the sample here, and you are done 👌