Hi all,
another delegation questions. Thanks already for the help.
I've set up my app to dynamically switch the datasource (I'm using 7 different sharepoint lists).
I do this as I use individual access rights per sharepoint list row (with power automate) - here Microsoft recommends a maximum of 10k rows which I would soon reach if I wouldn't use the dynamic data source selection.
To get the dynamic selection, in my App onstart I'm selecting the correct sharepoint list based on the current user and save it as CurrentListSource.
This I'm then using for my gallery. It works but with delegation issues and can therefore only see the first 2000 items. Is there any way to stay flexible with the sources but avoid these delegation errors?
I'm using this App onstart:
- Set(AppLanguage, "en");
ClearCollect(colPlants, Plant_Mapping);
// --- 2. Dynamic List Selection Logic ---
// Create the Claims token for the current user once
Set(CurrentUserClaims, "i:0#.f|membership|" & Lower(User().Email));
// Look up the current user's configuration record using the Claims token
Set(
CurrentUserConfig,
LookUp(
Users_SharepointList,
// Compare the INDEXED TEXT column to the current user's email (Text = Text)
UID = User().Email
)
);
// --- 3. Set Global Variables ---
Set(
CurrentListName,
CurrentUserConfig.'Sharepoint List'
);
Set(
CurrentListSource,
Switch(
CurrentListName,
"List1", 'List1',
"List2", 'List2',
"List3", 'List3',
"List4", 'List4',
"List5", 'List5'
)
);
And this gallery items formula:
If directly reference a specific sharepoint list the error doesn't come up. So the issue must relate to the CurrentListSource.
Would be thankful for any suggestions on why this doesn't work.