SharePoint List Form – Form Editor

Over the years in SharePoint, there have been several different technologies to use, in order to do some customization to the out-of-box list forms.  No more SharePoint Designer for forms, no more InfoPath.  Yes, you can use Power Apps to customize forms, but now there’s another alternative!

If you have some pretty basic changes to make to the way your form looks, you can do it with the new form editor, right in the browser in SharePoint/Microsoft Lists!  (Microsoft Lists = SharePoint Lists)

Let’s get right to it.  I’ve got a list that I created using the travel requests template in SharePoint.

To get to the form editor, you can either click NEW to fill out a new form, or click to open an existing item to view (not edit) it.  I’ve found that this experience is less buggy when viewing an existing item, for some reason.  So, if you have a brand new list, go ahead and click the New button, fill out the form and save it so that there is at least  one item in your list.  Then, click the title of that item, to open it up to view it.   In this screenshot, you can see that I have created several test items in my list already.  The key here is to open and view an existing item, and check out the little Edit Form button at the top right.  That’s what we’ll be using throughout this post.

sharepoint-list-open-item

1.  Click Edit Form.

2.  Click Configure layout.

sharepoint-form-configure-layout

Side note: If you’re wondering about those other two options.  I wrote another post about some interesting things you can do with the Edit Columns option.  For the Customize with Power Apps option, here’s a free one-hour online self-paced course where I teach about this:  Power Apps Basics.

3.  When configuring the layout, there three main options.  Header, Body, and Footer.  You can click the Learn more link to see the official documentation with an example of some code. 
This is done in JSON code. I’m not a programmer. 
April Dunham has created a great video called JSON Intro for Microsoft 365 People.

sharepoint-apply-formatting-to

Since this is all done in JSON, and the little code editor (in the screenshot above) is just plain text, it’s easier to write the code by using a JSON editor, so the code looks nicer and is easier to troubleshoot.  I use free software that I downloaded, called Notepad++ and this even includes a language setting (on the language menu) that you can set to JSON, and there is a plugin (on the Plugins menu) called JSON Editor, which will tell you if you have errors in your code. 

Before we get into the formatting details, here is an example of the final product:

sharepoint-travel-request-formatted-form

Now let’s break it down:

Header

The part at the top of the form is the header.  In this example, I’ve got a little icon of an airplane, and the name of the form “Travel Request”.   I’m not going to teach JSON here (I’m not a dev), I’m just going to show you where in the example code you can change it slightly. 

Copy and paste Microsoft’s code for the header over to the area for the header.  By default, their code has an icon of some people (“Group”) and says “contact details for” (and then the Title of the list item).

sharepoint-form-header-code

Here’s how to change the icon.  Here is the list of the icons to pick from.  I searched and found the one that looks like an airplane.  You can hover over these to see the name.  There’s one called Airplane, and one called AirplaneSolid. 

search-office-icons

Therefore, in the code where it currently says “Group”, I changed it to “Airplane”.

Then, the second part that I have pointed out, is the text shown at the top of the form.  Their example combines some text with a field from the list, called Title.  I changed mine to just say  “txtContent”: “Travel Request”, but as long as you know the system (internal) names of your columns, you can use those in the code, it’s just trickier if you’re dealing with person columns, lookups, or managed metadata. (beyond my JSON skillset)

Body

Next, and more importantly, here is how to configure the body, the main part of your form.  The code is MUCH simpler:

sharepoint-form-body-formatting-travel

{
     “sections”: [
         {
             “displayname”: “Requester Info”,
             “fields”: [
                 “Trip title”,
                 “Requester”,
                 “Reason for travel”
             ]
         },
         {
             “displayname”: “Trip Details”,
             “fields”: [
                 “Destination”
             ]
         }
     ]
}

Here’s the breakdown.  I’ve created two sections in my form.  First of all, notice that I haven’t typed all of the field names in the code.  Any fields that you leave out will automatically end up at the bottom, in your last section.  You can create many sections, but each column can only be in one section.  You do not have any control over how many columns are shown, because the form will size itself to whatever resolution the form is being viewed on.  My sections are called “Requester Info” and “Trip Details”.  Unlike the header and footer code, you can just use the easy display names of your fields here.  All you need to do is list them with quotes around each one, and commas in between them.  Here, I’ve narrowed my browser window to see what happens.  Notice that the “Reason for travel” column in the first section wraps down to the next line.

sharepoint-travel-request-narrow-window

I’ll add a third section, and will call it “Approval and receipts”.  Remember to type the field names exactly, and use commas between fields.  Notice that the built in attachments field is listed as well.  That one can’t be re-named, but you can type the name of it in the section where you’d like it to appear.

sharepoint-travel-attachments

4.  After you’ve configured each of the parts, like header, body and footer, you can click Preview to see what it will look like, and click SAVE when finished.

Rearranging columns

If you’d like to rearrange the order that the columns are shown, don’t try and do it in the code, it won’t work.  Instead, go to the Edit Columns screen:

sharepoint-form-rearrange-columns

You’ll notice that the names of your sections are shown here, and you can drag fields up and down to rearrange them or move them from one section to another. 

Footer

The footer works the same way as the header.  In Microsoft’s example, their list has a text field called Email, and their footer has a hyperlink to send an email to that address.  A footer is not required, so you could just leave this blank.  For mine, I’ve tweaked it slightly so that it is just a hyperlink that sends an email to the HR department, but yours doesn’t need a hyperlink, it could just be text, just like the header.  Here is mine:

{
     “debugMode”: true,
     “elmType”: “div”,
     “style”: {
         “width”: “100%”,
         “text-align”: “left”,
         “overflow”: “hidden”,
         “border-top-width”: “1px”
     },
     “children”: [
         {
             “elmType”: “div”,
             “style”: {
                 “width”: “100%”,
                 “padding-top”: “10px”,
                 “height”: “24px”
             },
             “children”: [
                 {
                     “elmType”: “a”,
                     “txtContent”: “=’Send email to HR about ‘ + [$Title] + ‘ trip'”,
                     “attributes”: {
                         “target”: “_blank”,
                         “href”: “=’mailto:’ + ‘hr@contoso.com'”,
                         “class”: “ms-fontColor-themePrimary ms-borderColor-themePrimary ms-fontWeight-semibold ms-fontSize-m ms-fontColor-neutralSecondary–hover ms-bgColor-themeLight–hover”
                     }
                 }
             ]
         }
     ]
}

 

Thanks for reading, and check out my SharePoint, Teams, Power Apps and Power Automate training at my company’s website: iwmentor.com

Here is the Power Hour episode where I demonstrated this list form editor in this hour long video.

 

 

18 comments

  • Great article for List Form,
    any idea about include calculated column into New item form?

    Liked by 1 person

  • I liked SharePoint when anyone could use it … now the developers and code jockeys have taken over. Sad.

    Liked by 1 person

    • Anyone CAN use it. SharePoint hasn’t taken any of your options away. The solution she presents here is just a nice to have thing that some people may want. Some of us non-developers and non-code jockeys might want to cut and past some code sometimes. I don’t understand how to write it but I could cut and paste it to make it work.

      Liked by 1 person

  • Any idea if there is a way to get one field, lets say a multi-line text field, to span the entire row? I’ve tried putting that field in its own section within they body, but it will only take up the width of one of the columns

    Like

  • Do you know if there is a way for a field, lets say a multi-line text field can span the entire row? I’ve tried putting that field in it’s own section, but that didn’t work. I’m not sure how to apply a “style width 100%” to that specific field or section, or not sure if it’s possible.

    Like

  • Thank you. Is there a way to add a notes column (multiple lines of text) with a wider width span using this format? I’d like to cut down on the amount of text wrap and scrolling where possible.

    Like

  • Thank you Laura. Using this format my comments icon next to edit forms no longer appears. Any idea?

    Like

  • Great information. Thanks Laura.

    Like

  • Did you find out how to make the email link in the footer dynamic to eg. the person listed in the responsible field. So for each item the link will send an email to person selected as responsible.

    Like

  • Christy Anderson

    Hi Laura,
    Nice Article! Do you know how to change an entry-box tip on the New Item Form, from “Enter value here” to something more specific like “Enter value in this format xxx-xx-xxx”
    Thanks

    Like

  • Thank you very much.
    Is there a way to customize the size/width in “body” without going through power app?
    thanks in advance

    Like

Leave a reply or question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.