JSON list formatting to show/hide items based on SharePoint group membership

%3CLINGO-SUB%20id%3D%22lingo-sub-1522752%22%20slang%3D%22en-US%22%3EJSON%20list%20formatting%20to%20show%2Fhide%20items%20based%20on%20SharePoint%20group%20membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522752%22%20slang%3D%22en-US%22%3E%3CP%3EHoping%20someone%20can%20confirm%20something%20for%20me.%20Here%20is%20the%20scenario%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20SharePoint%20list%20with%20a%20'Managers'%20column%20(type%3A%20Person%2FGroup).%3C%2FP%3E%3CP%3EI%20have%20created%20a%20SharePoint%20group%20called%20'Managers%20SP%20Group'.%3C%2FP%3E%3CP%3EI%20have%20created%20an%20Office%20365%20group%20called%20'Managers'.%3C%2FP%3E%3CP%3EI%20have%20added%20'Managers'%20to%20the%20'Managers%20SP%20Group'.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20list%20is%20populated%20with%20items%2C%20and%20the%20'Managers'%20column%20is%20populated%20with%20SharePoint%20groups%20e.g.%20'Managers%20SP%20Group'.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20create%20a%20custom%20view%20using%20JSON%20formatting%20that%20shows%2Fhides%20items%20in%20the%20list%20based%20on%20whether%20the%20user%20viewing%20the%20list%20is%20a%20member%20of%20'Managers%20SP%20Group'%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQuestion%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ea)%20Is%20this%20possible%3F%3C%2FP%3E%3CP%3Eb)%20If%20so%2C%20what%20is%20the%20JSON%20required%3F%20I%20know%20that%20if%20I%20used%20a%20person%20column%20populated%20with%20single%20users%20it%20is%20as%20follows%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3E%22display%22%3A%20%22%3Dif(%5B%24Managers.email%5D%20%3D%3D%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F31142%22%20target%3D%22_blank%22%3E%40me%3C%2FA%3E%20%2C''%2C'none')%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E...but%20I%20don't%20know%20what%20this%20would%20be%20for%20using%20a%20group.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20someone%20can%20help!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1522752%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGroups%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EJson%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EJSON%20formatting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Elist%20formatting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

Hoping someone can confirm something for me. Here is the scenario:

 

I have a SharePoint list with a 'Managers' column (type: Person/Group).

I have created a SharePoint group called 'Managers SP Group'.

I have created an Office 365 group called 'Managers'.

I have added 'Managers' to the 'Managers SP Group'.

 

The list is populated with items, and the 'Managers' column is populated with SharePoint groups e.g. 'Managers SP Group'.

 

I want to create a custom view using JSON formatting that shows/hides items in the list based on whether the user viewing the list is a member of 'Managers SP Group'

 

Question:

 

a) Is this possible?

b) If so, what is the JSON required? I know that if I used a person column populated with single users it is as follows:

"display": "=if([$Managers.email] == @me ,'','none') 

...but I don't know what this would be for using a group.

 

Hope someone can help!

 

Thanks

0 Replies