Reputation: 177
I recently encountered an issue on a Power App developed by someone else using Sharepoint data as a source where new records stopped appearing due to the delegation limit.
The data is largely split across 3 nested tables.
Table A is the parent of table B, Table B is the parent of Table C.
The Code being used is structured as below (part of the SharePointIntegration OnEdit property):
ClearCollect(
Items,
AddColumns(
ShowColumns(
Filter('Table B','Table A'.Id = SharePointIntegration.SelectedListItemID),
"TABLE_B_COLUMNS"
) As TBL_B,
"Table_C",
ShowColumns(
Filter('Table C', 'Table B'.Id = TBL_B.ID),
"TABLE_C_COLUMNS"
)
)
);
I have been scrounging around various youtube videos, documentation, articles, etc., but cannot seem to find a solution that works in this case.
The delegation notes in the documentation states the below, which seems to be part of the problem:
The SharePoint ID field for a table is a number field in Power Apps. However, SharePoint only supports the equal ('=') operation for delegation on an ID field.
I am looking for a workaround that ideally will not require changes to the structure of the Sharepoint source data.
In case it was unclear, for this specific application this only applies when a record is selected in Sharepoint to be edited or viewed. The individual records for one item will never be beyond the delegable limit, but the combination of all items can be which is why newer items are no longer appearing.
I have attempted the method shown on this source, which does not seem to work with Sharepoint sources: https://powerusers.microsoft.com/t5/Building-Power-Apps/500-item-limit-in-CDM-entity-search-filter-need-to-switch-to-asp/m-p/22980/highlight/true#M9872
I have also tried various methods like using 'StartsWith' instead of '=' etc. but nothing seems to be working.
This seems like a common problem so I am sure someone has come up with a solution but I have not been able to find anything straightforward or specific, so any ideas or advice would be greatly appreciated.
Upvotes: 0
Views: 2156
Reputation: 51
You can try this delegation workaround that uses Power Automate to query SharePoint lists far beyond the delegation limits. No collections required. https://powerusers.microsoft.com/t5/Community-App-Samples/No-Delegation-Limit-SharePoint-List-Power-App/td-p/2330721
https://youtu.be/EH-YndEPIiI?si=3vzU6Q6Ob1JG2IlM
Upvotes: 1
Reputation: 4365
It takes some thought to get around delegation.
status
, phase
, etc.Concurrent()
function and grab all the records
Concurrent(
Collect(col1,
Filter(LIST,
And(
ID_COPY >= 1,
ID_COPY <= 2000
)
)),
Collect(col2,
Filter(LIST,
And(
ID_COPY >= 2001,
ID_COPY <= 4000
)
)),
Collect(col3,
Filter(LIST,
And(
ID_COPY >= 4001,
ID_COPY <= 6000
)
))
);
ClearCollect(colAll, col1, col2, col3)
Caveats:
Collect()
's, but from lugging colAll
around your code and into your Galleries
.ID
column is not delegable. So you'll need to make an ID_COPY
column and filter off that.
number
data type to workUpvotes: 0
Reputation: 333
It may be that your SelectedListItemID is a string and not an Int in your Power App. Use it like ID = Int(SharePointIntegration.SelectedListItemID)
.
The reverse is also true, if you are trying to avoid delegation issues searching a text field with a number use textField = Text(numberValue)
Upvotes: 0