SharePoint List Form JSON Body Formatting

When it comes to customizing SharePoint list forms, JSON formatting has emerged as a powerful tool. It allows you to transform the default, often bland, user interfaces into engaging and user-friendly experiences. One of the key aspects of JSON formatting is understanding how to format the JSON body, which is the heart of your customization.

Customize SharePoint Forms with JSON
Customize SharePoint Forms with JSON

In this article, we'll delve into the intricacies of SharePoint list form JSON body formatting. We'll explore what it is, why it's important, and provide practical examples to help you get started. By the end, you'll have a solid understanding of how to format JSON bodies to create stunning SharePoint list forms.

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

Understanding SharePoint List Form JSON Body Formatting

JSON (JavaScript Object Notation) formatting in SharePoint allows you to customize the appearance and behavior of list forms. The JSON body is the core of this formatting, containing the rules and properties that define how your list form will look and function.

Editing a Form: InfoPath
Editing a Form: InfoPath

Formatting the JSON body involves structuring this data in a specific way to achieve the desired outcome. It's like writing a recipe: if you follow the instructions (the JSON body formatting) correctly, you'll get a delicious dish (a beautifully customized SharePoint list form).

Why JSON Body Formatting Matters

Free 22+ HTML5 Signup & Registration Forms - HTML, CSS
Free 22+ HTML5 Signup & Registration Forms - HTML, CSS

JSON body formatting is crucial for several reasons. Firstly, it enables you to create visually appealing forms that align with your organization's branding. This consistency can enhance user experience and professionalism.

Secondly, it allows you to control the behavior of form elements. You can make fields required, hide them based on conditions, or even create dynamic forms that change based on user input. This level of control can improve data accuracy and user satisfaction.

Getting Started with JSON Body Formatting

Personal Data Sheet - Fill Out and Sign Printable PDF Template | airSlate SignNow
Personal Data Sheet - Fill Out and Sign Printable PDF Template | airSlate SignNow

Before you dive into JSON body formatting, ensure you have the right tools. You'll need a text editor (like Visual Studio Code or Notepad++) to write your JSON, and a browser that supports modern SharePoint features (like Microsoft Edge or Google Chrome).

To start, navigate to your SharePoint list and click on 'Edit' in the command bar. Then, click on 'Format this form' to open the formatting pane. Here, you can switch to 'Advanced mode' to start writing your JSON body.

Formatting the JSON Body: Key Elements

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

Now that we've covered the basics, let's dive into the key elements of JSON body formatting. Understanding these elements will help you create complex and engaging SharePoint list forms.

Here are some of the key elements you'll work with:

Corporate Form Design
Corporate Form Design
Client Challenge
Client Challenge
Database Programming - MS Access Programmers
Database Programming - MS Access Programmers
Stocktaking Template | Templates at allbusinesstemplates.com
Stocktaking Template | Templates at allbusinesstemplates.com
InfoPath Formatting Rule
InfoPath Formatting Rule
the application for disposal of human remains is shown in this document, which contains information on how to use it
the application for disposal of human remains is shown in this document, which contains information on how to use it
Free Informed Consent Form (B&W)
Free Informed Consent Form (B&W)
the term sheet is filled with information
the term sheet is filled with information
Booking Form Builder | SaaS Admin Dashboard UIUX by Be Confidency on Muzli
Booking Form Builder | SaaS Admin Dashboard UIUX by Be Confidency on Muzli
an image of a document with the name and number of items in each section on it
an image of a document with the name and number of items in each section on it
Free Editable Roof Access Log Template Excel
Free Editable Roof Access Log Template Excel
G
G
ServiceNow Client Scripts
ServiceNow Client Scripts
a blank form for a personal data sheet
a blank form for a personal data sheet
an info sheet with instructions on how to use the email list for site inspections
an info sheet with instructions on how to use the email list for site inspections
a sample form for a personal information form
a sample form for a personal information form
the application form is shown in this document
the application form is shown in this document
a printable sign up sheet with the date and time
a printable sign up sheet with the date and time
Free editable printable document templates | Canva
Free editable printable document templates | Canva
Medical Form For Clinic Use, Medical Clinic Patient Form Template, Patient Intake Form For Clinics, Massage Therapy Forms, Physiotherapy Assessment Form, Massage Client Intake Form, Client Intake Form Massage Therapy, Massage Consultation Form, Sports Massage Consultation Form
Medical Form For Clinic Use, Medical Clinic Patient Form Template, Patient Intake Form For Clinics, Massage Therapy Forms, Physiotherapy Assessment Form, Massage Client Intake Form, Client Intake Form Massage Therapy, Massage Consultation Form, Sports Massage Consultation Form
  • Properties: These define the appearance and behavior of form elements. For example, you can use properties to change the background color, font size, or make a field required.
  • Rules: Rules allow you to control the behavior of form elements based on conditions. For instance, you can hide a field if another field's value is 'Yes'.
  • Layouts: Layouts determine the structure of your form. You can create complex layouts with tabs, sections, or even conditional layouts that change based on user input.

Working with Properties

Properties are the building blocks of JSON body formatting. They allow you to customize the appearance and behavior of form elements. Here's a simple example of how to change the background color of a field:

"bgColor": "rgb(240, 240, 240)"

In this example, the background color of the field is set to a light gray. You can replace 'rgb(240, 240, 240)' with any valid color value.

Creating Rules for Conditional Behavior

Rules allow you to control the behavior of form elements based on conditions. Here's an example of how to hide a field if another field's value is 'Yes':

"hideIf": "@currentWeb.Title eq 'Yes'"

In this example, the field will be hidden if the value of the 'Title' field in the current web is 'Yes'. You can replace 'Title' and 'Yes' with any valid field name and value.

Practical Examples: Formatting JSON Bodies

Now that we've covered the basics, let's look at some practical examples of JSON body formatting. These examples will help you understand how to apply what you've learned to create custom SharePoint list forms.

Creating a Custom Form Layout

One of the most common use cases for JSON body formatting is creating custom form layouts. Here's an example of how to create a form with two tabs:

{
  "Principals": {
    "rows": {
      "fields": {
        "Title": { "width": 300 },
        "Description": { "width": 600 }
      }
    },
    "tabs": {
      "Tab 1": {
        "fields": {
          "Field 1": {},
          "Field 2": {}
        }
      },
      "Tab 2": {
        "fields": {
          "Field 3": {},
          "Field 4": {}
        }
      }
    }
  }
}

In this example, the form has a 'Principals' section with two fields: 'Title' and 'Description'. It also has two tabs: 'Tab 1' and 'Tab 2', each containing two fields.

Creating Conditional Form Behavior

JSON body formatting also allows you to create dynamic forms that change based on user input. Here's an example of how to show or hide a field based on the value of another field:

{
  "fields": {
    "ShowHide": {
      "showIf": "@currentField eq 'Show'"
    }
  }
}

In this example, the field 'ShowHide' will only be shown if the value of the current field is 'Show'. You can replace 'ShowHide' and 'Show' with any valid field name and value.

JSON body formatting in SharePoint list forms opens up a world of possibilities for customization. Whether you're looking to create visually appealing forms, improve user experience, or enhance data accuracy, JSON body formatting is a powerful tool in your arsenal.

So, what are you waiting for? Start exploring the possibilities of SharePoint list form JSON body formatting today. Your users will thank you, and you'll be well on your way to becoming a SharePoint customization guru.