SOLVED

Json formatting button visible based on title

Copper Contributor

Hi , 
Im trying to make button in sharepoint column visible based on a Name of the folder 
i have wrote this that works for other columns but when im trying it with Name it is hidden

 

 

 

 

 

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Send to approve",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"93b5-4b11-93c8-e83e3942e77c\"}"
},
"style": {
"background-color": "#CAEEE9",
"color": "black",
"visibility": "=if([${Name}]=='Statistics','visible','hidden')"
}
}
 

 

 

 

 


I tried [$Name] , [${Name}] , [$name] , [${name}] and all the combinations doesnt work ? Why its only problem when comparing to the Name

1 Reply
best response confirmed by frogozinski1200 (Copper Contributor)
Solution

@frogozinski1200 You have to use the internal name of your columns in the SharePoint JSON formatting. Internal name of SharePoint default Name column is FileLeafRef. You can follow this article to get the internal name of your columns in SharePoint list/library: How to find the Internal name of columns in SharePoint Online? 

Try using this JSON:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Send to approve",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"93b5-4b11-93c8-e83e3942e77c\"}"
  },
  "style": {
    "background-color": "#CAEEE9",
    "color": "black",
    "visibility": "=if([$FileLeafRef]=='Statistics','visible','hidden')"
  }
}

 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

1 best response

Accepted Solutions
best response confirmed by frogozinski1200 (Copper Contributor)
Solution

@frogozinski1200 You have to use the internal name of your columns in the SharePoint JSON formatting. Internal name of SharePoint default Name column is FileLeafRef. You can follow this article to get the internal name of your columns in SharePoint list/library: How to find the Internal name of columns in SharePoint Online? 

Try using this JSON:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Send to approve",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"93b5-4b11-93c8-e83e3942e77c\"}"
  },
  "style": {
    "background-color": "#CAEEE9",
    "color": "black",
    "visibility": "=if([$FileLeafRef]=='Statistics','visible','hidden')"
  }
}

 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post