I'm trying to filter a gallery, but a particular combination of conditions is returning no results, even though they work independently. I've confirmed in SQL that records exist that meet all the conditions. For context, I have it wrapped in a switch function with a couple extra dropdowns for my app, but the problem still exists when pared all the way back.
This works:
Filter( 'DataSource',
Condition1 = true,
Condition2 = false)
This works:
Filter( 'DataSource',
If(IsEmpty(DropDown.SelectedItems), true, DropDown.Selected.Code = Code),
Condition1 = true,
Condition2 = true)
But this returns no records, even when the dropdown is left blank:
Filter( 'DataSource',
If(IsEmpty(DropDown.SelectedItems), true, DropDown.Selected.Code = Code),
Condition1 = true,
Condition2 = false)
Solved! Go to Solution.
Hi Krishna, thanks for your response. Spending more time with it I realized it was due to a delegation error, rewriting the code as follows removed the error and fixed the search. Leaving this here in case it helps someone else!
If(IsEmpty(dropdown.SelectedItems),
Filter('datasource', Condition1=true, Condition2= false),
Filter('datasource', dropdown.Selected.Code = Code, Condition1= true, Condition2=false))
Hi @AParker ,
Sorry I don't see any difference between 2 Filter and the one you want to fix (unless my cheated me for some reason 😊 ).
also, may I know what is condition1=true? means the logical condition true?
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to help.
Regards,
Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Hi Krishna, thanks for your response. Spending more time with it I realized it was due to a delegation error, rewriting the code as follows removed the error and fixed the search. Leaving this here in case it helps someone else!
If(IsEmpty(dropdown.SelectedItems),
Filter('datasource', Condition1=true, Condition2= false),
Filter('datasource', dropdown.Selected.Code = Code, Condition1= true, Condition2=false))
Hi @AParker ,
If the issue is resolved could you please mark the relevant reply as the solution so that it will be useful to the new members in the community.
Regards,
Krishna
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
272 | |
255 | |
87 | |
38 | |
34 |
User | Count |
---|---|
347 | |
263 | |
130 | |
68 | |
48 |