Mar 17 2024 12:57 PM
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?
Mar 17 2024 10:21 PM
To extract the JSON formatting of standard or custom columns from a SharePoint list view, you can follow these steps:
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.
Mar 17 2024 11:19 PM
@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:
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.
Mar 19 2024 06:09 AM - edited Mar 19 2024 06:11 AM
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?
Mar 19 2024 06:50 AM
@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
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.
May 10 2024 11:12 AM
@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.