Hello!
I have a function in my app that filters a gallery based on a text value of an item and the user's email. I was wondering if it is possible to assign multiple values to one variable for each email. For example, if my email is person1@gmail.com, can I make it so that my gallery displays values where the gbl_filter_value is both "Pending L1 Approval" and say, "Submitted"?
Thank you so much!! This worked 😊
Sorry, here is the updated Gallery Item property:
SortByColumns(
Filter(
'Dashboard',
'Approval Status'.Value in gbl_filter_values.Value && // Correct the comparison here
(
StartsWith(Title, TextSearchBox1_1.Text) ||
StartsWith('Date Submitted', TextSearchBox1_1.Text) ||
StartsWith('Version #', TextSearchBox1_1.Text) ||
StartsWith('AFE Number', TextSearchBox1_1.Text)
)
),
"Title",
If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)
)
Give it a try and let me know!
Hello @samfawzi_acml,
Thanks for your reply! The first function is working but when I try the Items property for my gallery, it gives me the error "Incompatible types for comparison. These types can't be compared: Text, Table". How can I fix this?
Hey @hhuynhfm ,
Yes, it is possible to filter a gallery based on multiple values for a single user. Instead of setting gbl_filter_value to a single value, you can create a collection of values. Then, you can filter the gallery to display items that match any of the values in this collection. Here's how you can do it:
Update the Switch Statement:
Switch(
User().Email,
"person1@gmail.com",
ClearCollect(
gbl_filter_values,
"Pending L1 Approval",
"Submitted"
),
"person2@gmail.com",
ClearCollect(
gbl_filter_values,
"Pending L2 Approval"
),
"person3@gmail.com",
ClearCollect(
gbl_filter_values,
"Pending L3 Approval"
)
)
Updated Gallery Items Property:
SortByColumns(
Filter(
'Dashboard',
'Approval Status'.Value in gbl_filter_values &&
(
StartsWith(Title, TextSearchBox1_1.Text) ||
StartsWith('Date Submitted', TextSearchBox1_1.Text) ||
StartsWith('Version #', TextSearchBox1_1.Text) ||
StartsWith('AFE Number', TextSearchBox1_1.Text)
)
),
"Title",
If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)
)
Hope this will help!
Cheers
You could change your variable to be an Table variable and add multiple items to the array depending on the email. That way your can iterate through it or use the "in" operator to filter your gallery on multiple items.
Set(gbl_filter_value, Table("Pending L1 Approval" , "Submitted"))
your filter criteria can then be something like:
'Approval Status'.Value in gbl_filter_value
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2