From the contributor
How to use this sample
Summary
This sample demonstrates changing managed metadata (multiple) values to buttons that open (external) sites, documents or items on other links. Myself used this for redirecting users to information, like clients, projects or group related documents.
Example of Related client(s) references on a document item within a SharePoint Document library
Example of Related projects(s) references on a document item within a SharePoint Document library
Example of Institute Norm reference(s) on a document item within a SharePoint Document library
View requirements
This format can be applied to a Managed Metadata column.
How it works
For every value (term) of the metadata column, create a HTML hyperlink element (<a>) wrapped with a HTML Content Division element (<div>).
Hypertext reference (href) attribute of Hyperlink element (<a>) is loaded with URL (placeholder: [URL]) and the label of term. For example:
- [URL] is replaced by: https://[tenant].sharepoint.com/sites/Client-
- Term (label) equals Chadailha
- Outcome is:
- Label of button: Chadailha
- Button action; open new (browser)window with site: https://[tenant].sharepoint.com/sites/Client-Chadailha
How to use
- Add a Managed Metadata column to the list/library
- Copy JSON to code editor
- Replace placeholder [URL], with desired hyperlink
- Copy JSON from code editor
- Paste JSON in column formatting, custom formatting textbox
- Click on Save
Sample
| Solution | Author(s) |
|---|---|
| managed-metadata-button.json | Daniel Giessenburg |
Version history
| Version | Date | Comments |
|---|---|---|
| 1.0 | June 26, 2025 | Initial release |
Additional Notes
Disclaimer
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.