1

I have got a SharePoint list that i would like to display in a SharePoint Site.

Different Users should only see the elements that are meant for them. This is determined by the columns Zielgruppen (targit group) which is a Multiple lines of text field, and Zielpersonen (targit persons) which is a Person field.

If the User @me is not in Zielpersonen or the users Department (That's another question, how do I get the department of the User? Azure?) is not in Zielgruppen the Card should not be generated.

I've tried to change the display value to none but the card is still generated and takes up the space

"style": {
      "display": "=if ([$Zielgruppen] == '<<Users Department>>', 'flex', 'none')"
},
3
  • Any reason you are using "Multiple lines of text" column, are you adding multiple departments in single item OR department names are longer than 255 characters? Commented Sep 30, 2022 at 7:08
  • Zielpersonen is single selection or multiple selection people field? Commented Sep 30, 2022 at 7:16
  • Hi @Kirito, did you try my solution given below? let me know if you need any further help with this. Commented Oct 13, 2022 at 11:04

1 Answer 1

0

You can get department of people field using JSON formatting as well. Assuming internal name of your column is "Zielpersonen", you can get department like:

[$Zielpersonen.department]

So, try using this:

"style": {
    "display": "=if([$Zielgruppen] == [$Zielpersonen.department] || [$Zielpersonen.email] == @me, 'flex', 'none')"
},

You can get the correct internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?

Documentation: JSON formatting-syntax-reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.