Finally, SharePoint Received Form Formatting

Customizing the SharePoint List Form is one of the core areas most of businesses and developers investigated when we checked the SharePoint history.
 
In earlier versions of SharePoint Online, we didn’t have an OOTB option to customize the SharePoint Lists and Forms. When Microsoft brings the modern look and feel to SharePoint Online, they begin to provide the updates frequently.
 
With that update, SharePoint Online receives
  • Column Formatting (a JSON format to apply on each Column to change the look and feel on the List View)
  • View Formatting (a JSON to apply on the List view to change the look on feel on each row item)
Finally, Microsoft brought the most awaited feature called Form Formatting (Even though it is not a fully customizable – we can expect more updates on this in coming days) this is a very fantastic feature to the SharePoint List Forms.
 
In earlier days, Microsoft recommend us to use InfoPath, then PowerApps. Now most of the SharePoint Forms are running on PowerApps. For simple customizations also, we require a PowerApps, but this is going to change after the update on Forms Configuration.
 
Ok, what we can do with this?
 
SharePoint Online provides three configuration options to customize the forms. They are,
  • Header
  • Footer
  • Body
Header – helps to insert header section to the Form
 
Footer – helps to insert footer section to the Form
 
Body – helps to add the one or more sections and decide the columns on each section. Not allowed to format the section and columns (we can expect these features in coming days). 
 
We will transform the Form which from 1st image to 2nd image by using JSON Form Configurations.
 
Finally, SharePoint received Form Formatting!   Finally, SharePoint received Form Formatting!
 
Header
 
Follow the below steps to customize the header section in SharePoint List Form,
  • Click New in SharePoint List to open a new form
  • Click Edit Form icon button and select Configure Layout to open a Format panel
  • Select the Header from the dropdown Apply Formatting to
  • Enter the below code in the JSON format box to insert the header section
    1. {  
    2.     "debugMode"true,  
    3.     "elmType""div",  
    4.     "txtContent""New Employee Onboarding",  
    5.     "style": {  
    6.         "height""40px",  
    7.         "font-size""18px",  
    8.         "font-weight""600",  
    9.         "padding""10px",  
    10.         "color""#fff",  
    11.         "background-color""#383794"  
    12.     }  
    13. }  
    Finally, SharePoint received Form Formatting!
Then click Preview button to see the changes. Or click Save button to apply the configuration to the form.
 
Body
 
Follow the below steps to organize the columns in Body section.
 
In the Format Panel, select the Body from the dropdown Apply Formatting to
  1. {  
  2.     "sections": [  
  3.         {  
  4.             "displayname""Employee Name",  
  5.             "fields": [  
  6.                 "First Name",  
  7.                 "Last Name"  
  8.             ]  
  9.         },  
  10.         {  
  11.             "displayname""Details",  
  12.             "fields": [  
  13.                 "Address",  
  14.                 "Phone",  
  15.                 "E-Mail"  
  16.             ]  
  17.         },  
  18.         {  
  19.             "displayname""Referrence",  
  20.             "fields": [  
  21.                 "is Referred",  
  22.                 "Referred By",  
  23.                 "Attachments"  
  24.             ]  
  25.         }  
  26.     ]  
  27. }  
Finally, SharePoint received Form Formatting!
 
For now, we can only provide sections and field names in Body section. This helps to split the form in to sections and organize the column in section. If we are not specified any fields, those missed fields gets automatically organize in the last section.
 
Footer
 
Follow the below steps to inject the element and apply styles to the end of the form,
 
In the Format Panel, select the Footer from the dropdown Apply Formatting to
  1. {  
  2.     "debugMode"true,  
  3.     "elmType""div",  
  4.     "txtContent""© Ktskumar Portal",  
  5.     "style": {  
  6.         "height""10px",  
  7.         "color""#fff",  
  8.         "font-size""12px",  
  9.         "border-top""5px solid #eee",  
  10.         "background-color""#383794",  
  11.         "padding""10px"  
  12.     }  
  13. }  
Finally, SharePoint received Form Formatting!
 

Control Field Visibility in Forms

 
Form configurations is also used to show / hide the fields based on the conditional formula.
 
This feature allows us to use the Conditional Formatting on each field to show / hide based on other column values.
 
Follow the below steps to show / hide and apply the conditions,
  • Click New in SharePoint List to open a new form
  • Click Edit Form icon button and Edit Columns to open the Edit Column panel
  • Select checkbox to show the columns in the added section
  • Unselect checkbox to hide the column in the section
  • Click the ellipses and Select Edit Conditional Formula to open the Formula panel
  • Enter the formula in the panel and click Save to apply the formula.
Finally, SharePoint received Form Formatting!
 
Before applying the formula
 
Finally, SharePoint received Form Formatting!
 
After applying the formula
 
If Referred is selected, the Referred By column is visible in the form. Otherwise Referred By column is not shown in the form.
 
Finally, SharePoint received Form Formatting!
 
There are some disadvantages to the Form Configuration like
  • Form looks wider in the page
  • CSS and styles are unable to apply to the Body section
We hope to get updates to get these features. Other than that, this is a very expected feature to customize the entire Form. Now, we don't need to use PowerApps for simple customizations.