Share via

Conditional formatting based on access

Gwen 0 Reputation points
Mar 20, 2023, 7:09 PM

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.
11,230 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,331 Reputation points Microsoft External Staff
    Mar 21, 2023, 9:37 AM

    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.