Share via

JSON List Column formatting broken

Anonymous
2024-11-21T19:29:52+00:00

I use below JSON code display an SPO list URL column item as a pill/rounded rectangle with white text and w/ blue background color. (column formatting) This has worked for a couple years now but, suddenly after an apparent SPO update the list it will not display the URL field alternate text. I have narrowed it down to @currentField.desc seems to be broken. @currentField displays the actual URL but .desc no longer displays the alt text. Is there going to be a fix for this or am I going to have to go back to legacy webpart pages w/ CSS?

Code: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "style": { "display": "inline-block", "padding": "5px 10px", "background-color": "#0054AE", "border-radius": "7px", "color": "white", "font-weight": "bold", "text-decoration": "none", "text-align": "center", "white-space": "nowrap" }, "attributes": { "target": "_blank", "href": "[$URL]" }, "txtContent": "@currentField.desc" }

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-11-21T20:57:08+00:00

    Hi DM_4242,

    Thanks for posting in the community.

    We would love to help you, however, since your query is related to JSON code, and our team focuses on general SharePoint built-in queries, we have a specific channel Microsoft Q&A Community coping with questions about JSON code, I recommend you post a new thread there for help (click "Ask a question" and add the tag SharePoint).

    Sorry that our category may have limited resources on checking on your concern further. Thank you for your cooperation and understanding!

    Sincerely,

    George | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments