sharepoint online – How to export or backup column formatting JSON values?

You can get the JSON code applied to column formatting using PnP PowerShell like:

$field = Get-PnPField -List "JSONFormatting" -Identity "Status" -Includes Title,CustomFormatter
$field.CustomFormatter

Output:

enter image description here


You can also get the JSON using SharePoint REST API like:

<siteUrl>/_api/Web/Lists/getByTitle('JSONFormatting')/fields?$select=Title,CustomFormatter

Output:

enter image description here


For list views: Use below endpoint:

<siteUrl>/_api/Web/Lists/getByTitle('JSONFormatting')/views/getbytitle('All Items')?$select=Title,CustomFormatter

You can change the view name as per your requirements.