web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to fix this delega...
Power Apps
Answered

How to fix this delegation error?

(0) ShareShare
ReportReport
Posted on by 364

Hi all!

 

I've managed to get rid of all the delegation warnings in my app through the use of collections, better filters etc. I'm stuck on one though!

 

ClearCollect(
 submittedRecords,
 ForAll(
 'TA Gallery Add Delivery Styles'.AllItems,
 Patch(
 'Unit List',
 Defaults('Unit List'),
 {
 'User Name': 'TA - Value - Name'.Text,
 'MMU ID': 'TA - Value - ID'.Text,
 'Unit Name': 'TA - Value - Unit Name'.Text,
 'Unit Credits': Text('TA - Dd - Unit Credits'.SelectedText.Value),
 'Delivery Style': Text('TA - Dd - Delivery Style'.SelectedText.Value),
 'Hours per Session': Value('TA - Value - Hours'.Text),
 'Number of Sessions': Value('TA - Value - Sessions'.Text),
 'Teaching Hours': Value('TA - Value - Pre Total Hours'.Text),
 'Prep Hours': Value('TA - Value - Pre Total Sessions'.Text),
 'Academic Year': Text('Admin - Dd - Academic Year'.SelectedText.Value)
 }
 )
 )
);
Patch(
 'Unit List',
 LookUp(
 'Unit List',
 ID = First(submittedRecords).ID),
 {
 'Number of Students': Value('TA - Value - # Students'.Text),
 'Assessment Allocation': Value('TA - Value - Assessment Allocation'.Text)
 }
);

To summarise the above, I generate a collection of records that I submit, and patch them over to my SP list. However, as you can add multiple enteries under the same record title, I only want my "Number of Students" and "Assessment Allocation" to be copied once, so that when I report, I won't have the remove the duplicate values. 

 

However, when I send those single records here:

 

Patch(
 'Unit List',
 LookUp(
 'Unit List',
 ID = First(submittedRecords).ID),
 {
 'Number of Students': Value('TA - Value - # Students'.Text),
 'Assessment Allocation': Value('TA - Value - Assessment Allocation'.Text)
 }
);

The lookup for the record ID brings back a delegation warning. My only thought is that either its the usage of First, or that the arguments are different types? This is the offending line. The equals and the .ID are the ones with warnings:

 

ID = First(submittedRecords).ID)

 

Can anyone help please?

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    Hi @EpicTriffid 

    I would try storing the ID value in a variable, and then referring to that in your call to LookUp. Perhaps that might resolve the problem.

     

    Set(FirstSubmittedID, First(submittedRecords).ID);
    Patch( 'Unit List', LookUp( 'Unit List', ID = FirstSubmittedID, { 'Number of Students': Value('TA - Value - # Students'.Text), 'Assessment Allocation': Value('TA - Value - Assessment Allocation'.Text) } );

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard