Conditional formatting based on access

Gwen 0 Reputation points
2023-03-20T19:09:48.18+00:00

Hello,

I'm playing around with conditional formatting on SharePoint.
Is it possible to apply a conditional formatting based upon the groups/persons who have access to a folder/file?

Right now I can format items which are last modified by me:

{

"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",

"additionalRowClass": {

"operator": ":",

"operands": [

{

"operator": "==",

"operands": [

"[$Editor.email]",

"@me"

]

},

"sp-css-backgroundColor-BgMintGreen sp-field-fontSizeSmall sp-css-color-MintGreenFont",

""

]

}

}

I would like to do the same for when a "Groupname" is in the list of users with access.

However I don't know which fields to use to check for this.

Image

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,567 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 25,546 Reputation points Microsoft Vendor
    2023-03-21T09:37:54.1666667+00:00

    Hi @Gwen ,

    According to my research, there is a method you can have a try.

    1, Get the user account who can access the file\folder.

    2, Create a multi-line of text column, then manually enter these accounts into the fields corresponding to the file\folder.

    3, Hide this column.

    4, Use Json Searches whether this field contains the account that currently executes xiugaixiu'gai. If it contains it, perform the corresponding formatting. If it does not contain it, no operation is performed.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.