I'm trying to filter a collection in PowerApps like so:
Filter(AllRooms, "ComputerRoom" || "LaptopRoom" in Name)
However when I try this none of my rooms come up. If I use only one filter ("ComputerRoom", or "LaptopRoom") then the correct rooms come up. Is this is syntax thing? Or something that just isn't possible?
AllRooms
contains;
"ComputerRoom 1"
"ComputerRoom 2"
"ComputerRoom 3"
"LaptopRoom A"
"LaptopRoom B"
"ClassRoom 1"
"ClassRoom 2"
"ClassRoom 3"
"ClassRoom 4"
You can use the following expression to filter the rooms based on one value or the other:
Filter(AllRooms, "ComputerRoom" in Name || "LaptopRoom" in Name)
The || operator can be used to combine two Boolean (true/false) values; when used as your original question, it is actually trying to convert the values "ComputerRoom" and "LaptopRoom" to boolean values before "or-ing" them, which is why it's not working as you expect.