I am pulling my hair out over what seems so simple, but what I am doing wrong evades me.
I need several different Filter() commands work. The datasource is a SharePoint list, and a handful of columns are all Yes/No fields; let's call them A, B and C.
If I want to Filter() on all records for A and C, then this works:
Filter(datasource,A=true, C=false) although I expected Filter(datasource,A=true And C=false) to work but I get ALL the records in that case.
But here's what I also need:
Filter(datasource, (A=true Or B=true) And C=false) or various true/false combinations. In other words, how do I combine the Or and the And expressions? I have tried things like Filter(datasource,(A=true Or B=true), C=false) and A=true And C=false Or B=true but nope.
I have reviewed the documentation for Filter as well as reading through gobs of posts, and the Or or And expressions are reported to work. I was tickled when I tried just two conditions separated by a comma, but I haven't been able to extend that to three conditions, two And and one Or.
I am sure I will have a callous on my palm and a flat forehead when this is solved, as I slap my hand against my head: "I should have thought of that!"
Thanks in advance
Solved! Go to Solution.
Hi @lmheimendinger,
For and/or you need to bracket the "pairs" and also you do not need the true or false
Filter(
DataSource,
A && (!B || C)
)
means A is true and either B is false or C is true, whereas this
Filter(
DataSource,
(!A && B) || C
)
means EITHER BOTH A is false AND B is true OR C is true.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Are you using yes/no complex column in sharepoint? If so instead of check true check 1.
Filter( datasource, and(A=1,C=0)).
Hi @lmheimendinger,
For and/or you need to bracket the "pairs" and also you do not need the true or false
Filter(
DataSource,
A && (!B || C)
)
means A is true and either B is false or C is true, whereas this
Filter(
DataSource,
(!A && B) || C
)
means EITHER BOTH A is false AND B is true OR C is true.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Warren
That worked! Thanks. I learned a few things:
Now all is well in my apps world.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
184 | |
95 | |
62 | |
59 | |
58 |
User | Count |
---|---|
246 | |
165 | |
91 | |
76 | |
70 |