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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,037)