cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Help with Delegation warning

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
Filter('Timeregistrering (overtid)'; Ansatt.DisplayName = currentUser.FullName; Status = "Saved")


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

Spoiler
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: ""
}
}
)
)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Help with Delegation warning

@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."

View solution in original post

6 REPLIES 6
Highlighted
Super User
Super User

Re: Help with Delegation warning

@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."

View solution in original post

Highlighted
Helper I
Helper I

Re: Help with Delegation warning

Hi @mdevaney ,

That worked just perfect. Thanks 🙂

Highlighted
Super User
Super User

Re: Help with Delegation warning

@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."

Highlighted
Frequent Visitor

Re: Help with Delegation warning

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?

Highlighted
Frequent Visitor

Re: Help with Delegation warning

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

Thanks for the help 😃

Highlighted
Helper I
Helper I

Re: Help with Delegation warning

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

Thanks again 😅

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,182)