I'm trying to create a button that only appears if the "Zapůjčeno" column is empty.
{
"elmType": "button",
"txtContent": "Odeslat Žádost",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"7347b7be-696f-46c8-bae8-78c230a354b3\"}"
},
"style": {
"background-color": "#03A9F4",
"color": "white",
"visibility": {
"operator": "?",
"operands": [
{
"operator": "!=",
"operands": [
"[$ID]",
"1"
]
},
"hidden",
"visible"
]
}
}
}
If I try it with the default column "ID" it works, but if I want to use my column "Zapůjčeno" it doesn't work.
Thank you for your advice, I am a novice in SharePoint.
Is the column Zapůjčeno internal name the same as the display name? You can see the internal name of that column in list/library settings an then click on the column name. The internal name of this column will in the URL.
I think you can then use something like this:
{
"elmType": "button",
"txtContent": "= if([$Zapůjčeno_Internal_Name]=='','Odeslat Žádost', '')",
"customRowAction": {
"action": "executeFlow",
"actionParams": "='{\"id\": \"' + if([$Zapůjčeno_Internal_Name]=='','7347b7be-696f-46c8-bae8-78c230a354b3','') + '\"}'"
},
"style": {
"background-color": "#03A9F4",
"color": "white",
"visibility": {
"operator": "?",
"operands": [
{
"operator": "!=",
"operands": [
"[$ID]",
"1"
]
},
"hidden",
"visible"
]
}
}
}
Thank you for the advice. It works!