Hello All,
I have created 2 collections: colPartNumber and colMonth in OnVisible (Screen). I wanted to use them in filter boxes to see option "All". Filters should show option "All" and single distinct record from gallery in dropdown boxes. My gallery's source is excel file. I have no errors on formulas but gallery is filtering wrong.
On Dropdown1 where I have collection of all part numbers ("All") and distinct part number I can see correct information so showing me data but does not work on gallery so gallery is not filtering at all - nothing happens when I press part number or "All".
On Dropdown2_4 where I have collection of all months ("All") and distinct month I cannot see anything when press dropdown box only blank lines. I press any blank line and it's working for instance I pressed second blank line and gallery filters through 1st month but for some reason doesn't work with "All" option as it should be the first line.
Code for collections (Screen -> OnVisible):
ClearCollect(colPartNumber, {Result:"All"}, Distinct(Table10, 'PART NUMBER'));
ClearCollect(colMonth, {Result:"All"}, Distinct(Table10, month1));
Collect(colPartNumber, Distinct(Table10, 'PART NUMBER'));
Collect(colMonth, Distinct(Table10, month1))
Code for Gallery (Items):
If(
Dropdown1.Selected.Result="All" &&
Dropdown2_4.Selected.Result="All",
Filter(Table10, 'PART NUMBER'=Dropdown1.Selected.Result),
Filter(Table10, month1=Dropdown2_4.Selected.Result)
)
Codes for Dropdown boxes (Items):
colPartNumber
colMonth
Any ideas anyone, please?
Thank You!
Wow, great 😀
Thank You soo much!!! It's working fine now 🙂 !! just that I need to figure out how to make text on lines visible...
This should do the trick (replace the names of the controls):
Replace it with a new one, can you?
Thank You,
It looks like Dropdown1 is working great as it should but Dropdown2_4 works fine only if Dropdown1 is selected to "All".
When I choose eg. P611252 and "All" in Dropdown2_4 it shows nothing in gallery.
When I choose eg. P611252 and month 1 or 2 or any other it will show me all lines for all months in my gallery (not selected one,... but I don't know exactly what it says as lines are still blank...)
It looks like this and still shows blank lines:
As for the Items filtering, you got this
Dropdown1.Selected.Result <>"All",
Filter(Table10, 'PART NUMBER'=Dropdown1.Selected.'PART NUMBER')
So, anytime you got a month on 1, it will filter your gallery and stop checking any other conditions.
Try this
Dropdown1.Selected.Result <>"All" && Dropdown2_4.Selected.Result<>"All",
Filter(Table10, 'PART NUMBER'=Dropdown1.Selected.'PART NUMBER')
And you may also have to filter the month there.
ok,
Lets break it down to small bites.
For the "white months", plese select the dropdown in your canvas an check the font color and related properties.
Thank You! It's working almost ok...
Dropdown1 - when I choose any option it filters gallery fine.
Dropdown2_4 - when I choose any month it's working but only when Dropdown1 in selected on "All". If I pick any other number in Dropdown1 like P611252 and lets say month number 3, it will show me this below (so it won't show me all lines for month 3 but it will show me all lines for month 1 and 2):
...also as You can see the values for month are there but not visible... while I have Visibility turned on and the text colour is black on white background.
Hi, try Dropdown1.SelectedText instead of Dropdown1.Selected
Also, test these statements in labels, to make sure they return what you expect.