Hi everyone,
I am helped on the following and is working very well indeed.
Sort( Filter( 'My List', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value ), Date, Descending )
Now I want to also include additional filter as :
Dropdown4 selection as "Closed" ( It has tow selections "Open" & "Closed") This dropdown is on the gallery itself
I tried but no success yet.
Any help please.
Thanks
Regards
Solved! Go to Solution.
@K369 Try this,
Sort( Filter( 'My List', (IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value) && Dropdown4.Selected.Value="Closed" ), Date, Descending )
This is a tough one due to the delegation issues.
You can add multiple filters into the Filter() function simply by separating them with ,
But there's the problem with delegation. Not so nice (but working) solution would be to move all (If, IsBlank, IsMatch, ...) functions outside of the Filter().
the one with delegation problems:
Example:
Sort( Filter( 'My List', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value
//there goes the separator for the next filter
,
Location.Value = "hello world"), Date, Descending )
without the delegation problems:
Example:
(I'm sorry I'm too confused about applying it to someone else's list so I hope my picture would help you to imagine how tough these codes are:)
I've done this for 5 filters and the rows count of this code is 128.
Basically.. You have to get all the combinations outside of the Filter() function to get rid of the ,,delegation triangle"
Hello Proxyprochy
Thanks. Following is the information:
Original- Works well
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value ), Date, Descending )
---------------------------------------------------------------------------------------------------------------
Modified with errors
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value ) && Dropdown2.Selected.Value="Closed" ), Date, Descending )
Errors:
Invalid argument type. Expecting one of the following: Boolean, Number, Text, OptionSetValue
Invalid number of arguments: Received 1, Expected 2-3
@K369 Try this,
Sort( Filter( 'My List', (IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value) && Dropdown4.Selected.Value="Closed" ), Date, Descending )
This is a tough one due to the delegation issues.
You can add multiple filters into the Filter() function simply by separating them with ,
But there's the problem with delegation. Not so nice (but working) solution would be to move all (If, IsBlank, IsMatch, ...) functions outside of the Filter().
the one with delegation problems:
Example:
Sort( Filter( 'My List', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value
//there goes the separator for the next filter
,
Location.Value = "hello world"), Date, Descending )
without the delegation problems:
Example:
(I'm sorry I'm too confused about applying it to someone else's list so I hope my picture would help you to imagine how tough these codes are:)
I've done this for 5 filters and the rows count of this code is 128.
Basically.. You have to get all the combinations outside of the Filter() function to get rid of the ,,delegation triangle"
Hello all,
Apologies for a late reply as I was trying a lot with your kind suggestions:
CNT - It gives errors and can not figure out why... Still trying.
Hello proxyprochy
Apologies for a late reply as I was trying to understand and apply your solution, however giving me errors. Still trying
hello,
What errors exactly?
Can you show us the code you are using?
Hello Proxyprochy
Thanks. Following is the information:
Original- Works well
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value ), Date, Descending )
---------------------------------------------------------------------------------------------------------------
Modified with errors
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value ) && Dropdown2.Selected.Value="Closed" ), Date, Descending )
Errors:
Invalid argument type. Expecting one of the following: Boolean, Number, Text, OptionSetValue
Invalid number of arguments: Received 1, Expected 2-3
Hello CNT,
Thanks. Using solution suggested following is the information:
Original- Works well
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value ), Date, Descending )
---------------------------------------------------------------------------------------------------------------
Modified with errors
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value ) && Dropdown2.Selected.Value="Closed" ), Date, Descending )
Errors:
Invalid argument type. Expecting one of the following: Boolean, Number, Text, OptionSetValue
Invalid number of arguments: Received 1, Expected 2-3
Just check your brackets.
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value && Dropdown2.Selected.Value="Closed" ), Date, Descending )
btw:
I have no idea what the hell are you trying to achieve and this should not work. Check this first:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup
Hello Proxiprochy & CNT,
I have now tried both solutions and they work well. Very grateful indeed.
Solution1:
Sort( Filter( 'MyList', IsBlank(Dropdown1.Selected.Value) || Location.Value = Dropdown1
.Selected.Value && Dropdown2.Selected.Value="Closed" ), Date, Descending )
Works well, however when I select a blank on Dropdown1, where it should get all records and then filter based on dropdown2 is not happening. There are no errors. But is not filtering based on dropdown2 if dropdown1 is selected blank.
Solution2:
without the delegation problems:
Yes its working well , but here if I select blank on dropdown1 then the screen is blank. Here If I could get all records displayed and filtered by Dropdown2.
You both are right. I was making mistakes in brackets 🙄
This is the las reply and question before I close this one and I will click on solution accepted.
Thank you very much again
User | Count |
---|---|
256 | |
106 | |
92 | |
47 | |
37 |