Home > Enterprise >  Does Power Apps have the ability to write an If(foo in {bar1, bar2, bar3}){...} expression?
Does Power Apps have the ability to write an If(foo in {bar1, bar2, bar3}){...} expression?

Time:10-28

Suppose that I'm handling the Visible property of a form and I only want three users to see it. Suppose that I have their IDs (1234, 12345, and 123456) and that User.ID is a way to extract that. I want to write an expression like if(User.ID in {1234, 12345, 123456}, true, false). Does Power Apps support this concept in any way? I could of course write the equivalent switch or User.ID = 1234 || User.ID = 12345 || User.ID = 123456 trick, but I'm hoping to be able to use an ad-hoc collection inside an if.

CodePudding user response:

You can use the in operator in the language:

Form.Visible ==> User.ID in [1234, 12345, 123456]
  • Related