SharePoint column formatted button does not work in Tile View

Mcintosh, Rebecca 21 Reputation points
2025-02-26T10:56:51.64+00:00

Hello!

I wonder if someone can advise whether or not it is possible now to have a SharePoint Document Library in Gallery/Tile View to have a clickable button on it?

I have a column formatted to change the status of another field once clicked - works fine in list view.

But my user interface uses the Tile View and the button doesn't work. Seen a similar ticket here - https://learn.microsoft.com/en-us/answers/questions/471442/sharepoint-online-column-button-not-working-from-g?page=1&orderby=Helpful&comment=answer-830670#newest-answer-comment - which tells us how to view the button - but not how to get it to work! I still want the defaultClick to open the item as normal.

Any help greatly appreciated!

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,367 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Mcintosh, Rebecca 21 Reputation points
    2025-02-27T12:03:21.45+00:00
    {
    
     "elmType": "div",
    
     "attributes": {
    
    "class": "=if([$Status] == 'Awaiting Approval', 'ms-bgColor-tealLight ms-bgColor-teal--hover ms-fontColor-white ms-fontSize-12 ms-fontWeight-bold', 'ms-bgColor-transparent ms-bgColor-neutralQuaternaryAlt--hover ms-fontColor-neutralQuaternary ms-fontColor-tealLight--hover ms-fontSize-12')"
    
     },
    
    "customRowAction": {
    
    "action": "setValue",
    
    "actionInput": {
    
    "Status": "Approved"
    
     }
    
     }
    
     },
     {
    
    "elmType": "div",
    
    "attributes": {
    
    "class": "ms-bgColor-white sp-css-borderColor-neutralLight sp-card-borderHighlight sp-card-subContainer"
    
     },
    
    "customRowAction": {
    
    "action": "none"
    
     },
     "children": [
              {
                "elmType": "div",
                "attributes": {
                  "class": "sp-card-displayColumnContainer"
                },
                "children": [
                  {
                    "columnFormatterReference": "[$ChangeStatus]"
                  }
                ]
              },
    
    
    0 comments No comments

  2. Xyza Xue_MSFT 29,016 Reputation points Microsoft Vendor
    2025-02-28T07:30:44.0233333+00:00

    Hi @Mcintosh, Rebecca ,

    I'm glad to hear you solve the problem, thank you for your enthusiasm in posting your research success to help more people. If you have any issue about SharePoint, you are welcome to raise a ticket in this forum. I would make a brief summary of this thread:

    Issue Symptom:

    SharePoint column formatted button does not work in Tile View

    Current status:

    The issue has been solved. The solution is: add the customRowAction and all the formatting of the button from column along with the columnFormatterReference and then set the customRowAction for the container itself to none.

    {
    
     "elmType": "div",
    
     "attributes": {
    
    "class": "=if([$Status] == 'Awaiting Approval', 'ms-bgColor-tealLight ms-bgColor-teal--hover ms-fontColor-white ms-fontSize-12 ms-fontWeight-bold', 'ms-bgColor-transparent ms-bgColor-neutralQuaternaryAlt--hover ms-fontColor-neutralQuaternary ms-fontColor-tealLight--hover ms-fontSize-12')"
    
     },
    
    "customRowAction": {
    
    "action": "setValue",
    
    "actionInput": {
    
    "Status": "Approved"
    
     }
    
     }
    
     },
     {
    
    "elmType": "div",
    
    "attributes": {
    
    "class": "ms-bgColor-white sp-css-borderColor-neutralLight sp-card-borderHighlight sp-card-subContainer"
    
     },
    
    "customRowAction": {
    
    "action": "none"
    
     },
     "children": [
              {
                "elmType": "div",
                "attributes": {
                  "class": "sp-card-displayColumnContainer"
                },
                "children": [
                  {
                    "columnFormatterReference": "[$ChangeStatus]"
                  }
                ]
              },
    
    

    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!

    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.