0

Is there any way to format the ListView by using the SPFx extension same as we have format the ListView as JSON formatting?

I can format the ListView using the JSON format, but for that, I need to assign the JSON formatting to the lists. And whenever I will create a new list, then I have to assign the JSON formatting. But I want that will automatically apply the formatting on all the lists.

Note: My requirement is to apply the same formatting on all the lists to the existing and/or a new list on the SharePoint site.

1 Answer 1

1

This is not possible using SPFx extensions.

However, you can apply view formatting to lists programmatically using Set-PnPView command in PnP PowerShell.

Example:

Set-PnPView -List "MyList" -Identity "MyViewName" -Values @{CustomFormatter = @'my-json-formatted-string'@}

Reference: Updating a view format using PnP PowerShell

2
  • Okay. Thanks. Is there any other way that I will apply the formatting automatically? Commented Mar 30, 2021 at 4:54
  • I am not sure if there is any other way to apply view formatting to all existing & new lists. This is the quickest & easiest way. You just need to loop through all the lists on site & apply view formatting using above command. Commented Mar 30, 2021 at 5:08

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.