Conditional JSON formatting of button in SharePoint List base Person(Multiple selections)

Copper Contributor

I am looking for a solution for a formatting problem in one of my sharepoint columns. 

In one column I have a button which triggers a flow. 

 

I am aiming for a visability of the button in correlation of person column with multi-selection turned on. 

 

I want the visibility to be depended on current user not exists in the person list column. My goal is to only make this button visible for the users not exists in the person list column

 

AssignedUserList - Person  field with allows multi selections.

 

 

 

{
    "elmType": "button",
    "customRowAction": {
    "action": "defaultClick"
    },
    "txtContent": "Give feedback",
    "attributes": {
    "class": "sp-row-button"
    },
    "style": {
    "display": {
        "operator": "?",
        "operands": [
        {
            "operator": "==",
            "operands": [
            "@me",
            "[$AssignedUserList.email]"
            ]
        },
        "",
        "none"
        ]
        }
    }
}

 

 

 Thanks in advance

 Kannan

2 Replies

@Kannan_Kalisamy575 

 

Managed to find the solution 

PersonList is the Sharepoint list column person with multi selections.

 

"=if(indexOf(join([$PersonList.email],';'), @me) != -1, 'none', '')"

 

 

{
    "elmType": "button",
    "customRowAction": {
        "action": "executeFlow",
        "actionParams": "{\"id\": \"a4e98f73-b36b-48c6-8227-51a00e4cd26d\"}"
    },
    "txtContent": "Mark Complete",
    "attributes": {
        "class": "sp-row-button"
    },
    "style": {
        "float": "right",
        "display": "=if(indexOf(join([$MarkCompleted.email],';'), @me) != -1, 'none', '')"
    }
}

 

Hey Kannan,

would you mind posting a screenshot of how it looks, we are interested in that functionality :)

thanks!