0

This question is in regards to List Form formatting:

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/list-form-configuration

The order of the fields specified in the JSON I am entering in the Body section is not being respected.

For example, no matter where I move the field ColumnA, it will display in a fixed position somewhere else.

I've tried removing all formatting, saving, and entering again, but the problem still persists.

{
    "sections": [
        {
            "displayname": "Section 01",
            "fields": [
                "ColumnA",
                "ColumnD",
                "ColumnG",
                "ColumnK"
            ]
        },
        {
            "displayname": "Section 02",
            "fields": [
                "ColumnB",
                "ColumnE",
                "ColumnF"
            ]
        },
        {
            "displayname": "Section 03",
            "fields": [
                "ColumnO",
                "ColumnC",
                "ColumnJ"
            ]
        },
        {
            "displayname": "Section 04",
            "fields": [
                "ColumnH",
                "ColumnI",
                "ColumnL",
                "ColumnM",
                "ColumnN"
            ]
        }
    ]
}

So if my boss says:

I want ColumnA displayed at the start of the section

All I can say is that:

I have configured it that way, but it is not working

which obviously isn't an acceptable answer.

Is this a bug?

How can it be resolved?

4
  • 1
    What is the data type of column A? Is it always shown at the bottom of Form? Aug 9, 2022 at 4:25
  • 1
    Also, you have to use display name of columns here and not internal names. Cross check this & let me know if it helps. Aug 9, 2022 at 4:27
  • I will get back to you when I’m on PC re: column types and whether it only happens with certain column types (from memory, one was a ‘single line of text’, and one was a Person column). I have observed this across different lists, browsers, accounts and tenants, and colleagues have experienced it too. And yes, I always use display names 👍🏾 I just always thought it was a bug that Microsoft would fix one day. Aug 9, 2022 at 9:04
  • @GaneshSanap - I think I came across cause/solution/workaround, see posted answer. Thanks for your willingness to brainstorm the issue 👍🏽. Aug 10, 2022 at 4:06

1 Answer 1

1

I think I have stumbled across a solution, or atleast a workaround.

There are three locations where column order can be defined:

  1. List Settings > Column ordering (old school)

  2. List > + New > Configure layout > Body (JSON formatting)

  3. List > + New > Edit columns (drag and drop ordering)

My understanding was the the JSON formatting in location 2 would override the others.

However, I found that setting field order in location 2 would not be reflected in the order defined in location 3.

So this is what I had to do:

  • Define field order in location 2
  • Define the same field order in location 3
  • Define the same field order in location 1

Then the field order showed as desired in the form.

I still think there in something buggy in the implementation on Microsoft's end, i.e. the logic in their code is not clearly defined as to which method of column ordering should override the others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.