I might not know how to ask the question or there is no answer out there so let me see if I can explain.
I have a list in SharePoint that has a people field (Owner). My users want to filter the list I give them in the PowerApps canvas app by an indeterminate set of user names.
So I tried to create a context text variable like this:
UpdateContext({OwnersToSearch: " Owner.DisplayName = """ &
Left(Concat(OwnerSearchDataCard.SelectedItems, DisplayName & """ ||
Owner.DisplayName = """),
Len(Concat(OwnerSearchDataCard.SelectedItems, DisplayName & " ||
Owner.DisplayName = ")) - 22) })
With three selected Owners in the default combo box I get this output when I show the "OwnersToSearch" variable in a label.
Owner.DisplayName = "User1 Smith" || Owner.DisplayName = "User2 Smyth" || Owner.DisplayName = "User3 Jones"
And I have tried to use the variable OnwersToSearch in my very simple collection filter:
ClearCollect(collectionFiltered, Filter(collectionAllActive,OwnersToSearch)
as you can see I am filtering a collection of All Active rows in SharePoint to just get the Active rows with one of the three users as the Owner.
Since I do not know how many User Names will be selected and PowerApps doesn't have an index into combo box table of results. I figured the Concat with Len and Left should get me the user names and then inserting the Quoting and || (or) separator I thought that would solve my problem.
Buy the filter returns 0 records from the All Active list when I am sure that there are at least 5 per user which I verified in SharePoint.
Is there a way to use my variable or another variable in a Filter refinement? Or is there another creative solution to my need?
Thanks,
Dave