SharePoint online - SharePoint List Webpart JSON code not fully rendering

Peter Board 20 Reputation points
2024-09-12T07:52:31.0966667+00:00

We have had a standard bit of JSON code working for a long time on our SharePoint Intranet, I just discovered today (possibly its been an issue for a while, when I asked some users), that the textContent field of a Hyperlink in the JSON code is not rendering in the newer SharePoint list webpart in SharePoint online.

The hyperlink still works (it renders a field named Link, that has the URL, the field named Title has the text label, and a field named Description contains the tool tip for the hyperlink). They can hover the mouse over the Link column on the ASPX web page in SharePoint, and they will see the URL at the bottom of the browser, and the tooltip, but the Hyperlink renders / appears as a blank cell.Screenshot 2024-09-12 174014

Blank hyperlink in the Webpart, Tooltip showing, Tooltip / Description field, also rendered as a standard column next to the hyperlink, so you can see that it does render plain text fields fine in the Webpart.

Does anyone know how to work around this bug that MS seem to have introduced? Any idea when it will be fixed?

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "=if(@currentField == '', '** No URL Specified **', [$Title])",
  "style": {
		"font-size": "11pt",
        "white-space": "nowrap"
      },
  "attributes": {
    "href": "@currentField",
    "target": "=if(indexOf([$Title], '(Link)' )>0, '_blank','_self')",
    "title": "[$Description]",
    "class": ""
  }
}

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,810 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 36,171 Reputation points Microsoft Vendor
    2024-09-13T02:23:16.7033333+00:00

    Hi @Peter Board,

    Per my research and test, this should be issue in sharepoint backend. And I noticed that some end users have the same issue. It is highly recommended that you can raise a new ticket in SharePoint feedback. And I will vote up the ticket for you. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


3 additional answers

Sort by: Most helpful
  1. Peter Board 20 Reputation points
    2024-09-13T02:27:00.7266667+00:00

    Thanks, i will submit a ticket

    0 comments No comments

  2. Peter Board 20 Reputation points
    2024-09-13T02:35:14.0533333+00:00
    0 comments No comments

  3. Peter Board 20 Reputation points
    2024-10-04T07:03:57.57+00:00

    Hi Ratheon,

    It looks like it has been corrected now in the updated Webpart, the JSON code is interpreting properly. So the problem now looks to have been resolved.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.