cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Bulk Update in foreach loop without delegate warning

I want to update in sharepoint list in for each loop without delegate warning

I have used below command. But it's giving me delegate warning.

 

ForAll(Filter(Gallery1_1.AllItems,Checkbox2_1.Value=true And Upper(FirstApproverLabel_1.Text)=Upper(User().Email)),Patch('Payment Requests',LookUp('Payment Requests',PaymentRequestID= PaymentReqIDLabel_1.Text),{Status:pendingApproval}));

 

How can i update without delegate warning

15 REPLIES 15
WarrenBelz
Super User
Super User

Hi @Anonymous ,

I will try to fix a couple of problems, then see how it goes. Firstly neither Upper and User()Email are not delegable., so two things - at App OnStart, do this

Set(
    vUserMail,
    User().Email
);
Set(
    vUserMail,
    Upper(vUserMail)
)

Then on your Text Control OnChange

Set(
    vApprover,
    Upper(FirstApproverLabel_1.Text)
)

then on its Default

If(
    !IsBlank(vApprover),
    vApprover,
    Parent.Default
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Anonymous
Not applicable

Thanks. Delegate warning i am getting from control- PaymentReqIDLabel_1.Text

 

I am using grid. on the basis of few conditions. I am updating sharepoint list using 

PaymentReqIDLabel_1.Text column. Hope I am able to explain my problem

 

Hi @Anonymous ,

What type of field is this in your data source?

Anonymous
Not applicable

PaymentReqIDLabel_1.Text  is test field and status is lookup type field

OK @Anonymous ,

Your issues are bigger than Delegation - you cannot Patch a lookup field like that. It is a complex field type. Where is it getting the data from (pending approval sounds like a Choice field)

Anonymous
Not applicable

Its typo mistake. It's choice type of field

Ok @Anonymous ,

Instead of 

{Status:pendingApproval}

you would have

{
   Status:
   {Value:pendingApproval}
}

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Anonymous
Not applicable

Thanks

 

how can i remove that delegate warning, it' coming from PaymentReqIDLabel_1.Text

Thansk @Anonymous ,

What do you mean by a test field?  If you meant Text, this is Delegable. The name PaymentRequestID suggests a numeric ID.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,455)