1

Is there a way to write my JSON in a single file and then use it in many lists views?

My situation is that I have a format that I want to use over and over again (more than a hundred) and the potential exists for this formatting to change, which would mean I would have to go into hundreds of views and make the same simple change over and over again vs. just one file.

In a "perfect world" I would write a json file (text) and just write the "include" statement where needed. Is this possible?

I searched for this and have been unable to find anything, so guessing it doesn't exist, thought I'd ask here just in case.

2

There is no such a built-in functionality to reference a JSON file in list view formatting feature. You may consider using following workaround.

Set-PnPView Could apply the json format into the view.

 $listViewFormattingJSON = Get-Content -Raw -Path '{path}\Bulletin Board.json'

 Get-PnPList -Identity "{listname}" |Get-PnPView -Identity 'All Items'|Set-PnPView -Values @{CustomFormatter = $listViewFormattingJSON.ToString()}

I tested following JSON template and it works well

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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