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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,899)