Getting the proper SharePoint list columns internal names to use in List Formatting JSON

Question sent by a reader recently, on my Quick SharePoint Approvals using list formatting JSON to set field values formatting post:

Will this not work if my column name has a number in it?

I have to submit documents for 2 reviews, and I am using “1st Reviewer Status” and “2nd Reviewer Status” as the column names, but the above code will not populate the approved/rejected in that column. I modified the columns to “Reviewer One Status” and “Reviewer Two Status” and the code worked fine. But spelling out the values doesn’t look as clean, in my opinion.

List formatting uses the internal name for the columns. When creating it from the modern UI ,not all internal names are generated as we expect, especially with names containing numbers and special characters.

It’s a good practice among SharePoint Developers/Administrators to create the column with the Display name as what we want to be the ‘internal name’, using only characters that are not going to be encoded, then we rename it back to what we want to be the display name. Or to create columns via PowerShell with the internal name we want according to the limitations.

But in case you already have a list in use with some columns in a similar situation, you might want to find the exact internal name for the column if you want to use List formatting JSON

How to find the column internal name

You can find the correct encoded internal name for the column by accessing the ‘List Settings’ menu:

Then opening the column settings:

You will see something like this in the browser URL after loading the Column Settings:

/_layouts/15/FldEdit.aspx?List=%7BD436EDB0-7828-439E-9C2C-8CB6084F0B8F%7D&Field=_x0031_stReviewerStatus

Note that you have at the end: Field=_x0031_stReviewerStatus, meaning that your field internal ID will be _x0031_stReviewerStatus on this case.

Conclusion

In order for such fields to work properly with list formatting JSON, grab the internal field names from there and use them wherever you need in the formatting JSON template.

Leave a Reply

Your email address will not be published. Required fields are marked *