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

Notifications

Announcements

Community site session details

Community site session details

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

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
    36,383 Super User 2025 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard