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
Solved! Go to Solution.
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!
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!
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 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!
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!
@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!
@CarlHRVA I think I understand what you are needing. But let me try and put it into words to make sure.
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
)
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!
@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:
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!
User | Count |
---|---|
158 | |
91 | |
68 | |
63 | |
63 |
User | Count |
---|---|
210 | |
155 | |
93 | |
81 | |
71 |