1

Previously, we created links in a 'Single Line of Text' column via JSON column formatting.

This basic functionality is documented here:

https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#turn-field-values-into-hyperlinks-basic

And the example they provide is:

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "a",
   "txtContent": "@currentField",
   "attributes": {
      "target": "_blank",
      "href": "='http://finance.yahoo.com/quote/' + @currentField"
   }
}

A simple example without the dynamic content would therefore be:

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "a",
   "txtContent": "TEST",
   "attributes": {
      "target": "_blank",
      "href": "https://google.com"
   }
}

After the recent Microsoft List update that Microsoft rolled out, documented here:

https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-lists-easier-better-faster-stronger/ba-p/3806075

clicking on the links that our JSON column formatting generated does not open the links.

When we click on the links, nothing happens.

To clarify, the examples provided above do work, but the custom JSON column formatting that used to work for us, no longer does.

The links do work if we REMOVE the ?env=WebViewList suffix from the list URL.

This undesired behaviour is happening on all sites in all lists in our tenant.

Steps To Reproduce

01) Create a Microsoft List

02) Go to the list and ensure it has the suffix ?env=WebViewList
(so that it is displayed in the modern 'Microsoft Lists' look), eg:

https://<your-tenant>.sharepoint.com/sites/<your-site>/Lists/<your-list>/AllItems.aspx?env=WebViewList

(Note: this issue can be reproduced in both personal Microsoft Lists and those stored in SharePoint Sites).

03) Create a column in the list of type 'Single Line of Text'.

04) Click on the column heading and select Column Settings > Format this column > Advanced mode

05) Paste the following code and click Save

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "attributes": {
    "href": "https://www.google.com",
    "target": "_blank"
  },
  "style": {
    "text-decoration": "none"
  },
  "children": [
    {
      "elmType": "button",
      "attributes": {
        "class": "ms-fontColor-themePrimary ms-fontColor-themeDark--hover",
        "title": "Click Me"
      },
      "style": {
        "border": "none",
        "background-color": "transparent",
        "cursor": "pointer"
      },
      "children": [
        {
          "elmType": "span",
          "attributes": {
            "iconName": "Attach",
            "class": "ms-font"
          },
          "style": {
            "padding-right": "2px"
          }
        },
        {
          "elmType": "span",
          "txtContent": "Click Me"
        }
      ]
    }
  ]
}

06) Add an item to the list so that you can see the generated link

07) Click on the generated link and nothing will happen

08) (If you are testing on a list within a SharePoint Site, remove the ?env=WebViewList from the list URL and reload the list and the link will work).

Update:

After further investigation, if I click to the right of the link text, the link DOES work, but if I click on the link text itself the link DOES NOT work.

1 Answer 1

0

since the easier/better/faster/stronger...broken update all my hyperlinked fields are now not working.

I have hyperlinked images, hyperlinked icons, hyperlinked strings and the hover shows the correct URL, it just doesn't actually click. Double click and they all just open the edit item form, not actually launch the link.

I also noticed - with the hyperlinked strings - if you click the whitespace around the text it launched - doesn't work for images or icons.

This is all tied to the Lists App now showing in SharePoint. Only some users in some tenants have the new list experience.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.