Hi,
Maybe someone can help... so I have a gallery with data taken from Excel file. I am trying to filter gallery through parts and months so 2 filters applied on it. My code for Items in gallery is:
Filter(Table5, ('PART NUMBER'=Dropdown1.Selected.Result), ('month' = Dropdown1_1.Selected.Result))
My code for first filter is: Distinct(Table5, 'PART NUMBER')
...and second filter is: Distinct(Table5, 'month')
It all works well, the gallery filters through months and parts as I want but I can't manage to create collection and add option: show "All" in both filters.
I tried with Collect(colparts, Distinct(Table5, 'PART NUMBER') on Screen -> OnVisible and then change code on filter to colparts but it doesn't work and shows "We didn't find any data." for a collection. I would appreciate any help and ideas amybe other solutions how I can see all options in filter other than collecting data, please 🙏
Hi, I tried this code for collection and seem to be working fine, just changed the one for gallery slightly - couldn't see it straight away I had to close the app and opened again. After I've done that I could see results 🙂 ! Thank You very much for Your time and solutions!
What type of field in month in Table5 ? Also look in View > Collections > colMonth - what do you see in the month field ?
Hello again,
So I just copied Your codes but my second dropdown box is called Dropdown2_4 and here are my errors so exactly what You posted. I am surprised as well as it seem to work for everyone this solution when I check other forums or youtube...
am I missing something here, please?
The code is valid if your original posted code was and it is implemented as I posted. The collections are run at App OnStart and these are then the Items of your dropdowns. Can you please post (in Text) the exact code you are getting the error on and where you are using it.
Thank You but now I have these errors:
Hi @marcy_pi ,
Make two collections (App OnStart will do) - these will then be the Items of your dropdowns
ClearCollect(
colPart,
{Result: "All"},
Distinct(
Table5,
'PART NUMBER'
)
);
ClearCollect(
colMonth,
{Result: "All"},
Distinct(
Table5,
'month'
)
)
Then the Items of the Gallery
Filter(
Table5,
(
Dropdown1.Selected.Result = "All" ||
'PART NUMBER' = Dropdown1.Selected.Result
) &&
(
Dropdown1_1.Selected.Result = "All" ||
'month' = Dropdown1_1.Selected.Result
)
)
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.
Visit my blog Practical Power Apps
What I want is option "All" in a dropdown box so it could show me all parts in a specific month or all months for a specific parts depending on filters. I thought that I need to get all parts from a gallery and make a collection of it then assign them to "All" option in dropdown box but I struggle to do that...
Hello,
Thank You for Your response, it works the same as my codes, so still not showing me option "All" in a dropdown box but filters well through the gallery.
Hi @marcy_pi ,
I assume here you want all items displayed it there is not selection made in the drop-downs - if so try
Filter(
Table5,
(
Len(Dropdown1.Selected.Result) = 0 ||
'PART NUMBER' = Dropdown1.Selected.Result
) &&
(
Len(Dropdown1_1.Selected.Result) = 0 ||
'month' = Dropdown1_1.Selected.Result
)
)
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.
Visit my blog Practical Power Apps