web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help filtering a galle...
Power Apps
Answered

Help filtering a gallery from a different screen

(0) ShareShare
ReportReport
Posted on by 601

Hello,


I have a PowerApp for a document library that I am creating and in it I have a landing screen where I would like to allow users to filter the gallery on a second screen before navigating to the second screen on-click. I read that I should accomplish this with a temporary collection and setting the data source of the gallery to the temp collection but I've not been able to get the formula to work. For now I am only trying to establish one filter for a field I'll call "Zone". "Zone" is a look up column, looking up to a "Master Process List". I use a drop down for this look up field "Zone" and would like to filter the gallery of the library with this selected value and navigate to the screen screen on-click. The formula I am currently using is:

 

ClearCollect(

       temp,

       Filter(

               'Process Document Library',

                Zone = Dropdown1_1.SelectedText.Value

)

);

Navigate(

              'Approver/OwnerScreen',

               None)

 

This is returning an invalid argument type. I'm sure that I am supposed to use the ID for this in some capacity but I don't fully understand this aspect of look up columns yet. Thanks for any help! @wyotim 

Categories:
I have the same question (0)
  • Verified answer
    wyotim Profile Picture
    2,545 on at

    Hey @CarlHRVA, try this and let me know if it does the trick:

    ClearCollect(
     temp,
     Filter(
     'Process Document Library',
     Tower.Value = Dropdown1_1.Selected.Zone 
     )
    );
    Navigate(
     'Approver/OwnerScreen',
     None
    )

    Here I am assuming that Zone is the item being looked up in the dropdown (which is in turn connected to the 'Master Process List') and Tower is the field in 'Process Document Library' that is being referenced. Again, let me know if this does or doesn't work!

  • CarlHRVA Profile Picture
    601 on at

    Yes! Thank you @wyotim . I have just about figured it out and got there with your help. The only thing different in my formula that worked was:

     

    ClearCollect(
     temp,
     Filter(
     'Process Document Library',
     Tower.Value = Dropdown1_1.Selected.Result //changed from .Zone to .Result//
     )
    );
    Navigate(
     'Approver/OwnerScreen',
     None
    )

     

    Now what I will attempt to do, before I ask you for more help (thank you so much, really), is set it up so that they can filter on only one OR multiple different fields at a time. Thank you again!

     

  • wyotim Profile Picture
    2,545 on at
    I’m sure you’ll nail it! But should any issues arise, I’m happy to assist!
  • CarlHRVA Profile Picture
    601 on at

    @wyotim Wondering if you might help me with my filter function.

     

    What I currently have is:

     

    Distinct(
     If(
     IsBlank(Dropdown1_1.Selected.Result),
     'Document Library'.Operating_Text,
     IsBlank(Dropdown3_1.Selected.Result),
     'Document Library'.Operating_Text,
     Filter(
     'Document Library',
     'Organizational Model'.Value = Dropdown3_1.Selected.Result
     ).Operating_Text
     ),
     Operating_Text
    )

     

    What I'd like to do is include a Region filter for each statement. So... 

     

    If Dropdown1_1 is blank then Document Library.Operating_Text when Region = Dropdown5.Selected.Result

     

    Does that make sense? 

     

    Thank you!

  • wyotim Profile Picture
    2,545 on at

    Hey @CarlHRVA, apologies for the radio silence on my end. I caught a bad illness (not the big one in the news) and am just getting back to the land of the living. I saw you had another topic that you solved yourself (great job!); do you still need some assistance with this filter? I'd be happy to help out if you do!

  • CarlHRVA Profile Picture
    601 on at

    @wyotim Welcome back. No apologies necessary, you've been ridiculously helpful and I'm sorry to hear you were feeling under the weather! I could definitely still use help with this filter. Did I properly explain what I was trying to do before? Thank you!

  • wyotim Profile Picture
    2,545 on at

    @CarlHRVA I think I understand what you are needing. But let me try and put it into words to make sure.

     

    • If Dropdown1_1 is blank, filter 'Document Library' by Region using Dropdown5.Selected.Result
      • (Assumed by me) If Dropdown5 is blank, don't filter 'Document Library'
    • If Dropdown1_1 is not blank, filter 'Document Library' by 'Organizational Model'.Value using Dropdown3_1.Selected.Result
      • If Dropdown3_1 is blank, don't filter 'Document Library'

    In essence, if Dropdown1_1 is blank, use Dropdown5 to filter; otherwise use Dropdown3_1. 

     

    Does that sum it up? If so, try this and see if it does the trick:

    Distinct(
     If(
     IsBlank(Dropdown1_1.Selected.Result),
     Filter(
     'Document Library',
     Region = Dropdown5.Selected.Result || IsBlank(Dropdown5.Selected.Result)
     ),
     Filter(
     'Document Library',
     'Organizational Model'.Value = Dropdown3_1.Selected.Result || IsBlank(Dropdown3_1.Selected.Result)
     )
     ),
     Operating_Text
    )

     

  • CarlHRVA Profile Picture
    601 on at

    Hey @wyotim thanks for the thoughtful response, as always. That's not exactly what I am trying to achieve unfortunately. First thing to note, Dropdown5 will always have a value. First they select a value for Dropdown 5(Region) and then they can add additional filters onto that, should they choose to do so.  If Dropdown5 and Dropdown1_1 is not null, filter on both else, if Dropdown5 and Dropdown3_1 is not null, filter on both, else if Dropdown5, Dropdown1_1 and Dropdown3_1 is not null, filter on all 3, else filter on just Dropdown5. Does that make sense? Thanks!

     

     

  • wyotim Profile Picture
    2,545 on at

    @CarlHRVA Thank you for clarifying! I certainly was misunderstanding you there. Try this instead:

    Distinct(
     Filter(
     'Document Library',
     Region = Dropdown5.Selected.Result,
     'What Dropdown1_1 Filters' = Dropdown1_1.Selected.Result || IsBlank(Dropdown!_1.Selected.Result),
     'Organizational Model'.Value = Dropdown3_1.Selected.Result || IsBlank(Dropdown3_1.Selected.Result)
     )
     ),
     Operating_Text
    )

    The 'What Dropdown1_1 Filters' is there because I wasn't sure what it was. Earlier in the thread, you had a Tower.Value associated with Dropdown1_1, so that might be it. 

     

    To explain this a bit, in the Filter function, multiple filter conditions (separated by commas after the data source) act like they are joined by an And (&& when used symbolically). I added some Or statements (the || symbol) in there means as well. You might know this already but for those who come upon this thread in the future, for And statements, all conditions must be true or the result is false. For Or statements, only one condition must be true; only if all conditions are false will it return false. So in this filter, we have three statements that must be true:

     

    1. A value must be selected for Dropdown5 that can be found in the Region field
    2. Either a selected value for Dropdown1_1 can be found in the (assumed) Tower field or Dropdown1_1 has nothing selected
    3. Either a selected value for Dropdown3_1 can be found in the Operational Model field or Dropdown3_1 has nothing selected

    Essentially, we have created a condition that accounts for values or no values being selected in Dropdown1_1 and Dropdown3_1. 

     

    Let me know if that does what you need! If not, we'll keep at it!

  • CarlHRVA Profile Picture
    601 on at

    @wyotim Thank you so much and sorry for the delayed response! I haven't had a chance to try this yet, we've had a million different things going on at once with the state of everything right now and my PowerApps have taken a back seat but I will give this a shot later today and likely have some more questions for you as well😂 Thank you as always.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard