How to extract standard/custom column JSON formatting from Sharepoint List View?

Copper Contributor

Is there an easy/complex way to extract standard/custom column JSON formatting from Sharepoint List View, so I could copy/paste it to column JSON formatting with slight mods? For example, in case of Document Library List View default "LinkFilename" column has some fancy formatting with extra functions like open/share/delete file, etc. Is there a way to mimic same behavior with column JSON formatting? Any ideas?

5 Replies

@roktoro 

To extract the JSON formatting of standard or custom columns from a SharePoint list view, you can follow these steps:

  1. Navigate to your SharePoint site and open the list or library for which you want to extract the JSON formatting.
  2. Go to the list view that contains the column formatting you want to extract.
  3. Click on the column header of the column whose JSON formatting you want to extract. This will open the column menu.
  4. Select "Column settings" from the column menu, and then choose "Format this column" from the dropdown menu.
  5. This will open the JSON formatting panel where you can view and edit the JSON formatting for the selected column.
  6. Copy the JSON formatting from the panel and paste it into a text editor or any other tool where you can save and modify the JSON as needed.
  7. Make any modifications to the JSON formatting as desired.
  8. Once you have modified the JSON formatting, you can apply it to another column by following the same steps and pasting the modified JSON into the JSON formatting panel for the target column.

By following these steps, you can extract the JSON formatting for columns in SharePoint list views and reuse or modify it as needed for other columns. Keep in mind that this method works for both standard and custom columns, allowing you to replicate the same formatting across different columns in your SharePoint list or library. The text was created with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

 

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

@roktoro By default there is no JSON formatting applied to Name (Linkfilename) column, hence you cannot copy or mimic it to another columns. 

 

However, you can open the context menu (with extra functions like open/share/delete file) using JSON column formatting and customRowAction

 

Simple Example

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "customRowAction": {
    "action": "openContextMenu"
  }
}

 

Note

  1. Context menu will be opened on "click" of column value and not on "hover" using above JSON
  2. You can apply additional formatting to above JSON to show it as button or with extra formatting like font-size, color, etc. Refer: SharePoint JSON formatting syntax reference 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap


1. I suppose same answer applies how to get tick/no tick mark formatting for boolean type column. There might be workaround, but no way to extract it as JSON code straight away from standard formatting for re-apply and/or customization, am I right?

2. Is there a way to extract style settings to be customized with JSON?

If I change default column formatting with something like:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField"
}

I'm not getting the same look as with "default" column formatting, so I wonder - is there an easy way to extract style information for further customization with JSON?

 

@roktoro Yes, same thing. However, there are few list formatting samples provided by community members on GitHub. You can look at those, use those as is or customize the JSON as per your requirements.

 

Check this link for all list formatting sample: List Formatting Samples 

 

Check this link for column formatting sample: List of Column Formatting Samples 

ganeshsanap_0-1710856224239.png


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@roktoro You're right that there isn't a direct way to extract the default JSON formatting from standard SharePoint list columns.

 

However, you can still achieve similar results by leveraging the library of open source JSON formatting samples maintained by the SharePoint community. These samples provide a great starting point to copy, paste and customize to your specific needs. Alternatively, you can apply your own custom JSON to a column and then access that JSON later from the column settings.

 

This allows you to reuse or modify the formatting for other columns as needed. The key in both cases is to start with custom JSON, either from the community samples or your own work, rather than trying to extract the default formatting. By building up a library of these JSON snippets, you'll be able to efficiently create a consistent look and feel across your lists and libraries.