My PowerApp application decides the Share point list to filter based on user details. For example, the Share Point list would change based on the region the user belongs to.
Share Point List: SalesTableEU SalesTableUSA
The mapping of User and the Sharepoint list to use is in another table named UserSettings.
First, i did a look up on UserSetting list, returned the SPListName (TableName) based on the user. This saved in a variable SelectedDS by
Set(SelectedDS, LookUp(UserSPLMapping, Title = User().Email, SPListName))
How should i pass the table name to the filter function based by this variable name - SelectedDS.
SortByColumns(Filter(SelectedDS, StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
I do not get the gallery populated when i use this variable, however when i hard code the table name, the gallery is populated.
Can you help me where i'm wrong and provide me a solution.