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 / Help with Delegation w...
Power Apps
Answered

Help with Delegation warning

(0) ShareShare
ReportReport
Posted on by 167

Hi 🙂,

 

Im wondering if it's possible to do what i'm doing here without a delegation warning.
If its not, I will look into the possibilty of auto cleaning the SPlist before it reach e.g. 1500 rows (settings are set to 2000), and store the data into a new list or something.

What I need to do is to update the status on all rows in gallery to "ForApproval". I will also use the same code for updating new statuses along the way.

 

My gallery has this code:

Spoiler (Highlight to read)
Filter('Timeregistrering (overtid)'; Ansatt.DisplayName = currentUser.FullName; Status = "Saved")
Filter('Timeregistrering (overtid)'; Ansatt.DisplayName = currentUser.FullName; Status = "Saved")


The code below with underlining is getting delegation warning.
Code:

Spoiler (Highlight to read)
ForAll(Gallery2.AllItems; Patch('Timeregistrering (overtid)'; First(Filter('Timeregistrering (overtid)'; Status="Saved"));
{
Status: "ForApproval";
Tittel: [@Tittel].Text;
Dato: [@Dato].SelectedDate;
Kunde: [@Kunde].Text;
SR: [@SR].Text;
Klokkeslett: [@Klokkeslett].Text;
Total: Totalt.Text;
Arbeid: [@Arbeid].Text;
Ansatt: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
Claims: "i:0#.f|membership|" & currentUser.Email;
Department: "";
DisplayName: currentUser.FullName;
Email: currentUser.Email;
JobTitle: "";
Picture: ""
}
}
)
)
ForAll(Gallery2.AllItems; Patch('Timeregistrering (overtid)'; First(Filter('Timeregistrering (overtid)'; Status="Saved"));{Status: "ForApproval";Tittel: [@Tittel].Text;Dato: [@Dato].SelectedDate;Kunde: [@Kunde].Text;SR: [@SR].Text;Klokkeslett: [@Klokkeslett].Text;Total: Totalt.Text;Arbeid: [@Arbeid].Text;Ansatt: {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";Claims: "i:0#.f|membership|" & currentUser.Email;Department: "";DisplayName: currentUser.FullName;Email: currentUser.Email;JobTitle: "";Picture: ""}}))
Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Power_Dude 

    The FIRST function cannot be delegated

    First(Filter('Timeregistrering (overtid)'; Status="Saved"))

     

    To remove the warning use LOOKUP instead.

    LookUp('Timeregistrering (overtid)'; Status="Saved")

     


    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Power_Dude Profile Picture
    167 on at

    Hi @mdevaney ,

    That worked just perfect. Thanks 🙂

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Power_Dude 

    LOOKUP also performs better too.  Why?  LOOKUP stops searching the datasource when it finds the first records whereas FILTER must retrieve the entire datasource and then get the 1st record 🙂

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • PrntScrn Profile Picture
    8 on at

    Hi,

     

    Actually, it did not work. I did not test it good enough. That will update the status of every user, and also overwrite the records that belongs to the other users. I need to only update the status of current user. Do you perhaps have a solution for that as well?

  • PrntScrn Profile Picture
    8 on at

    Forget it, I added && to the formula.
    LookUp('Timeregistrering (overtid)'; Status="Lagret" && Ansatt.DisplayName = currentUser.FullName)

    Thanks for the help 😃

  • Power_Dude Profile Picture
    167 on at

    Sorry for all the confusion but I am @PrntScrn as well.
    I have a couple of users for testing and stuff.

    Thanks again 😅

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 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard