Forum Discussion

JWJ's avatar
JWJ
Copper Contributor
May 29, 2024

Format column in modern list

I have a JSON format code that ive applied to a SPO list.  This JSON creates a button that simply links to another library.

 

This is the code 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "a",
  "attributes": {
    "href": "='https://abcd.sharepoint.com/sites/hubby/Lists/Workflow%20Log/Item%20History.aspx?FilterField1=LinkTitle&FilterValue1='+[$WFHistoryLink]",
    "target": "_blank"
  },
  "children": [
    {
      "elmType": "button",
      "txtContent": "WF Log Details",
      "style": {
        "background-color": "#FFFFFF",
        "color": "#000000",
        "width": "100%",
        "font-weight": "normal",
        "padding": "5px"
      }
    }
  ]
}

 

In a modern list, you CANT click directly on this "button" if you move your mouse just below it it changes from an arrow to a hand and then its clickable.  Is there something in the JSON I can adjust for this?

  • fratrucc's avatar
    fratrucc
    Copper Contributor
    Do you have the new microsoft list experience? Becouse since the roll out i had problem with all the JSON formatted column. I had the same issue with some icon placed in hyperlink column. The href work in the whole field, but doesn't work if the user press on the icon. All worked fine with the old previus list experience.

    I think that they have some bug right now with JSON formatting with the new experience
    • JWJ's avatar
      JWJ
      Copper Contributor
      Strangely enough, its being rolled out in my tenant seemingly randomly. Some users ONLY have access to the new list experience, and most don't. but yes, same boat, old list work fine. I may end up creating a PowerApp for the list.
      • fratrucc's avatar
        fratrucc
        Copper Contributor
        Is not that strange, some random users started to see it before here too, right now i see that some sites have the new experience and other don't. For sure all the new team sites that i create have the new expereince. That's it.

        The only problem here is the fact that we can't even try the new version before to adapt our customization. I hope that the'll fix how this new experience manage JSON formatting, not all the senario work well with power apps.

Share

Resources