cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wissemz
Regular Visitor

Delegation problem with sharepoint list

Hi all,

 

I have a list sharepoint named : Demandes (3000 rows).

 

I would like to update this list with a collection named DirectorDemandes, this is my code : 

ForAll(
DirectorDemandes;
Patch(
Demandes;
LookUp(Demandes;ID = DirectorDemandes[@ID]);{Statut: {Value: "En attente validation DRH"}}
)

But i have a delegation problem, not all the item are updated.

 

Can someone help me please?

3 REPLIES 3
Drrickryp
Super User
Super User

Hi @wissemz 

I am assuming you have set the item limit to 2000 in the Advanced Settings for your app. First, create two collections from the same list, one sorted ascending the other sorted descending.  

 

ClearCollect(listA,Sort(list,Ascending);ClearCollect(listD,Sort(list,Descending)

 

Then combine the lists to eliminate the overlap (duplicates)

 

ClearCollect(
             ListAll,ListA,Filter(
                                   listD, Not(
                                               ID in listA.ID
                                           )
                             )
)

 

Then use your ForAll() and Patch() to update your SPlist using ListAll in your formula

This solution will only work if the list does not exceed 4000 items.

i think i get the solution : 

 

patchResult: ForAll(
RenameColumns(ForValidationDemandes; "ID"; "ID1");
UpdateIf(
Demandes;
ID = ID1;
{Statut: {Value: "Valider"}}
)
)

@wissemz 

I think you will still have a delegation problem because RenameColumns() is not a delegatable function.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,642)