cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CindyZ
Level: Powered On

Filtering a Gallery with Multiple Drop Downs

I've looked at lots of threads and tutorials and still cannot figure this out so I'm wondering if someone can point me in the right direction.  

 

I have 4 drop downs and 1 text input search box.  I can get each of them to work perfectly if I have only 1 filter on my gallery. BTW, a collection does not work well in this case because I need to be able to navigate/connect to my parent record from this gallery.  (That is another question). 

 

Anyway, when I've tried to combine all of these into one formula, my drop downs don't do anything; just stay at whatever I last filtered.  

 

Can someone please help me understand what I'm missing.  Also, do I put that combined formula on a filter icon or the gallery?  

 

Thank you. 

 

Drop Downs

Distinct('Submit Legal Requests PowerApp','Enquiry Type'.Value)

Distinct('Submit Legal Requests PowerApp','Created By'.DisplayName)

Distinct('Submit Legal Requests PowerApp','Assigned Reviewer'.DisplayName)

Distinct('Submit Legal Requests PowerApp',Status.Value)

 

Input Text Search Box

Filter('Submit Legal Requests PowerApp',txtinpEnquiryFilter.Text in Title)

 

 

Gallery Formula for each Item

Filter('Submit Legal Requests PowerApp','Assigned Reviewer'.DisplayName = 'dd--AssignedReviewer'.Selected.Result)

Filter('Submit Legal Requests PowerApp',Status.Value = 'dd--Status'.Selected.Result)

Filter('Submit Legal Requests PowerApp','Created By'.DisplayName = 'dd--CreatedBy'.Selected.Result)

Filter('Submit Legal Requests PowerApp','Enquiry Type'.Value = 'dd-EquiryType'.Selected.Result)

Filter('Submit Legal Requests PowerApp',txtinpEnquiryFilter.Text in Title)

 

Thanks so much! 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filtering a Gallery with Multiple Drop Downs

Hey! @CindyZ , I am glad that it worked for you. 

 

The formula applied to get the results, works in this way:
 
Filter('Submit Legal Requests PowerApp'txtinpEnquiryFilter.Text in Title && 'Assigned Reviewer'.DisplayName = 'dd--AssignedReviewer'.Selected.Value && Status.Value = 'dd--Status'.Selected.Value &&  'Created By'.DisplayName = 'dd--CreatedBy'.Selected.Value && 'Enquiry Type'.Value = 'dd-EquiryType'.Selected.Value)
 
'Submit Legal Requests PowerApp' is your data source and you have applied filter in a way that puts an "AND" condition that returns only the records, that satisfy all the mentioned conditions. Be it Title, Assigned Reviewer.DisplayName or all the attributes mentioned as a part of formula. As the filter returns all the records corresponding to matching condition, we applied it directly onto the Gallery.
 
You can ask your questions here or start a new thread too! Completely your choice.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
8 REPLIES 8
Super User
Super User

Re: Filtering a Gallery with Multiple Drop Downs

Hi @CindyZ ]

 

Can you please try to combine all the filters as one expression using "&&" operators. You can refer to the expression:
 
Filter('Submit Legal Requests PowerApp', txtinpEnquiryFilter.Text in Title && 'Assigned Reviewer'.DisplayName = 'dd--AssignedReviewer'.Selected.Value && Status.Value = 'dd--Status'.Selected.Value &&  'Created By'.DisplayName = 'dd--CreatedBy'.Selected.Value && 'Enquiry Type'.Value = 'dd-EquiryType'.Selected.Value)
 
This code should be put in the Items property of Gallery Control.
 
For your second question, using a collection won't restrict you from navigating/connect to your parent record. You need to map your collection details on the Parent Record Screen. If you have very dynamic data, that changes frequently with records less than 2000 after applying all the filters, then directly connecting to data source would be a good option. If your data doesnot change frequently, then going for a collection would be a better choice, so you do not need to make connection to data source everytime, instead you can utilize the local collection.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
CindyZ
Level: Powered On

Re: Filtering a Gallery with Multiple Drop Downs

Now I get "Name isn't valid. This identifier isn't recognized beneath each "Selected.value" with value underlined in red.  

Super User
Super User

Re: Filtering a Gallery with Multiple Drop Downs

@CindyZ 

 

Can you try Selected.Result in place of Selected.Value?
CindyZ
Level: Powered On

Re: Filtering a Gallery with Multiple Drop Downs

@yashag2255 Thank you ever so much.   It works!

 

I'd never have found that on my own even though I'd just been looking at properties just before your answer came through and it did show "result" in Value.   Is there an explantion to go with this so I can understand what I did or why you had me do that? 

 

Also, this now leads me to a couple of other questions that are related regarding using a collection and/or moving forward on this.  Should I open a new thread or continue here since you have provided a solution to my specific question.   

 

Thanks again! 

Super User
Super User

Re: Filtering a Gallery with Multiple Drop Downs

Hey! @CindyZ , I am glad that it worked for you. 

 

The formula applied to get the results, works in this way:
 
Filter('Submit Legal Requests PowerApp'txtinpEnquiryFilter.Text in Title && 'Assigned Reviewer'.DisplayName = 'dd--AssignedReviewer'.Selected.Value && Status.Value = 'dd--Status'.Selected.Value &&  'Created By'.DisplayName = 'dd--CreatedBy'.Selected.Value && 'Enquiry Type'.Value = 'dd-EquiryType'.Selected.Value)
 
'Submit Legal Requests PowerApp' is your data source and you have applied filter in a way that puts an "AND" condition that returns only the records, that satisfy all the mentioned conditions. Be it Title, Assigned Reviewer.DisplayName or all the attributes mentioned as a part of formula. As the filter returns all the records corresponding to matching condition, we applied it directly onto the Gallery.
 
You can ask your questions here or start a new thread too! Completely your choice.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
CindyZ
Level: Powered On

Re: Filtering a Gallery with Multiple Drop Downs

Thanks so much for the explanation!  Really!   

 

So, I did build the collection that allowed me the flexibility of not having to meet all the conditions - which is ultimately what I want.  I'd like my choices to be very flexible and be able to reset my filters which I was doing in my collection. 

 

Something I'd read made me think I could not use the collection to navigate back to my parent record.  I cannot remember now what that was.  How would I make that connection? 

 

Do you feel I'd be better using a collection or a gallery.  It really does not matter to me; I just want my data to be flexible and be able to choose a record from the Gallery/ or collection and move to different places in my app according to my selection?  

 

I hope that makes sense.  And, I'm sorry the answer is just not coming to me -- at this point I've been at this one problem for days and fatique is setting in along with tons of growth and understanding about collections, filters and variables. 

Super User
Super User

Re: Filtering a Gallery with Multiple Drop Downs

@CindyZ 

 

Collection is a way to store data locally instead of making requests every time to the data source. This is not something similar to a Gallery. Gallery is a control that gets displayed on the screen and to fill in the data inside it, we either use a Data source or the collections we create.
 
Something I'd read made me think I could not use the collection to navigate back to my parent record.  I cannot remember now what that was.  How would I make that connection?
-- Answer to this would be: You cannot show a collection on the screen, you have controls in there that reflect the data from the collections. Regarding the Parent Record, you can use the Filter/Lookup queries to fill in the details of the items selected in Gallery.
 
Do you feel I'd be better using a collection or a gallery.  It really does not matter to me; I just want my data to be flexible and be able to choose a record from the Gallery/ or collection and move to different places in my app according to my selection? 
-- There is no comparison between the two. Each has its own capabilities. You can have forms to show the details specific to selected items. A collection can be used to store data in the local cache and that makes data access in the app faster.
 
I hope I was able to answer some of your questions!
 
Thanks, 
CindyZ
Level: Powered On

Re: Filtering a Gallery with Multiple Drop Downs

Just a quick thanks for your quick response yesterday.  I have everything back on track now.