Re: Use Set Function to Assign Multiple Values to One Variable
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