Customize SharePoint Online List Form Body with JSON Formatting

In the dynamic world of SharePoint Online, customizing list forms can greatly enhance user experience and streamline workflows. One powerful method to achieve this is by leveraging JSON formatting. JSON (JavaScript Object Notation) allows you to apply conditional formatting, style elements, and even add custom HTML to your SharePoint Online list forms, making them more intuitive and engaging.

Customize SharePoint Forms with JSON
Customize SharePoint Forms with JSON

Before delving into the specifics of JSON formatting, let's briefly understand why it's beneficial. Firstly, JSON formatting provides a no-code solution to customize SharePoint list forms, making it accessible to users without advanced technical skills. Secondly, it enables you to apply complex conditional formatting rules, allowing you to display different information based on specific criteria. Lastly, JSON formatting can significantly improve the visual appeal of your SharePoint list forms, aligning them with your organization's branding.

How to customize Forms in SharePoint Lists 📃
How to customize Forms in SharePoint Lists 📃

Understanding JSON Formatting in SharePoint Online

JSON formatting in SharePoint Online is based on the JSON language, which is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate. In the context of SharePoint, JSON formatting is used to apply styles and conditional formatting to list views and forms.

Client Challenge
Client Challenge

To get started with JSON formatting, you'll need to access the 'Format current view' or 'Format this item' option in your SharePoint list. This will open the JSON formatting panel where you can input your JSON code. Remember, JSON formatting is applied on a per-view basis, so you can have different formatting for different views of the same list.

JSON Formatting Syntax Basics

How To Make a SharePoint List Form in Seconds!
How To Make a SharePoint List Form in Seconds!

Before diving into complex JSON formatting, let's familiarize ourselves with some basic syntax. JSON formatting in SharePoint Online uses a specific syntax that includes properties and values. Properties are the elements you want to format (like 'bgColor' for background color), and values are the styles you want to apply (like '#FFFFFF' for white background).

Here's a simple example of JSON formatting syntax: ```json { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "additionalRowClass": "sp-field-severity--high", "bgColor": "#FFFF00", "iconName": "Warning" } ``` In this example, the background color of the row will be yellow ('#FFFF00'), and a warning icon will be displayed. The '$schema' property is required and points to the JSON schema for SharePoint column formatting.

Applying JSON Formatting to List Forms

How to create sites and site collections from a SharePoint Site Template | SharePoint Maven
How to create sites and site collections from a SharePoint Site Template | SharePoint Maven

Now that we've covered the basics of JSON formatting syntax, let's explore how to apply it to SharePoint Online list forms. To do this, you'll need to access the list settings and navigate to the 'Form settings' for the specific list form you want to customize.

Once in the 'Form settings', click on 'Edit' to open the form in edit mode. Here, you can use the 'Format this item' option to apply JSON formatting. Remember, you can apply different JSON formatting rules to different fields in the form, allowing for highly targeted customization.

Advanced JSON Formatting Techniques

Editing a Form: InfoPath
Editing a Form: InfoPath

While the basics of JSON formatting can help you achieve a lot, SharePoint Online also supports more advanced techniques. These include applying conditional formatting based on column values, adding custom HTML to your forms, and even using functions to perform calculations.

Conditional formatting allows you to change the appearance of a field based on its value. For example, you can make text red if a date is overdue. To do this, you would use the 'if' function in your JSON formatting, like so: ```json { "bgColor": "=if([$Title] == 'Overdue', '#FF0000', '#FFFFFF')" } ``` In this example, the background color of the row will be red ('#FF0000') if the title is 'Overdue', and white ('#FFFFFF') otherwise.

How to Do Branching in Forms
How to Do Branching in Forms
Database Programming - MS Access Programmers
Database Programming - MS Access Programmers
Client Challenge
Client Challenge
Free 22+ HTML5 Signup & Registration Forms - HTML, CSS
Free 22+ HTML5 Signup & Registration Forms - HTML, CSS
Digital Product Handover Form
Digital Product Handover Form
the dashboard page for an application with different user options
the dashboard page for an application with different user options
Client Form Template Layout
Client Form Template Layout
How to Easily Make an Attractive Application Form in Showit - vanessabucceri.com
How to Easily Make an Attractive Application Form in Showit - vanessabucceri.com
Artist Booking Form Template
Artist Booking Form Template
Corporate Form Design
Corporate Form Design
Personal Data Sheet - Fill Out and Sign Printable PDF Template | airSlate SignNow
Personal Data Sheet - Fill Out and Sign Printable PDF Template | airSlate SignNow
Create Fillable Forms in Word | Digital and Printable Forms
Create Fillable Forms in Word | Digital and Printable Forms
ServiceNow Client Scripts
ServiceNow Client Scripts
22+ Free Access Database Template
22+ Free Access Database Template
the information sheet for personal information is shown in this document, which contains information and instructions
the information sheet for personal information is shown in this document, which contains information and instructions
Standing Order Form |Template
Standing Order Form |Template
Peach Creative Minimalist Access Form
Peach Creative Minimalist Access Form
Custom Order Tracker Bundle, Commission Management System, 9 PDF Templates (Instant Download)
Custom Order Tracker Bundle, Commission Management System, 9 PDF Templates (Instant Download)
the customer facebook form is shown in this file, and it appears to be filled with information
the customer facebook form is shown in this file, and it appears to be filled with information
Client Challenge
Client Challenge

Adding Custom HTML to SharePoint List Forms

SharePoint Online also allows you to add custom HTML to your list forms using JSON formatting. This can be particularly useful if you want to display complex data or add interactive elements to your forms. To add custom HTML, you'll need to use the 'customHtml' property in your JSON formatting.

Here's an example of how you might use 'customHtml' to display a button in your list form: ```json { "customHtml": "" } ``` In this example, a button with the text 'Click me!' will be displayed in the list form. You can, of course, style this button and add functionality using HTML and JavaScript.

Using Functions in JSON Formatting

SharePoint Online's JSON formatting also supports the use of functions, allowing you to perform calculations and manipulate data directly in your JSON code. For example, you can use the 'concat' function to combine the text from two columns: ```json { "displayName": "=concat('Title: ', [$Title])" } ``` In this example, the display name of the field will be 'Title: ' followed by the value of the Title column.

JSON formatting in SharePoint Online is a powerful tool that can greatly enhance the functionality and user experience of your list forms. Whether you're looking to apply simple styles or complex conditional formatting rules, JSON formatting offers a flexible and accessible solution. So why not give it a try and see what you can create?