cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Walter_Wego
Frequent Visitor

Delegation when default populating one field with last entry for another field

 

Hi All, 

 

I am a little perplexed. I am a newbie so be gentle 😀. I am creating a fleet car usage Power App for my small Non Profit organisation. I am using a SharePoint list as the primary source.

Columns include 'Vehicle' (registration plates - populates in the app via a QR scan), 'KM at Start' (mileage at start of journey), 'KM at End'

I am trying to have the 'KM at start'  read as the last 'Km at End'  dependent on which vehicle has been selected from the list in the app - It needs to be the right mileage for the respective vehicle. 
I have managed to do this using this formula:

If(EditForm1.Mode = FormMode.New, Last(Sort(Car_pool_logs,Vehicle in TextInput1.Text ,Ascending)).'KMS at end',Parent.Default)

 

However this throws a delegation error. I have been struggling to work out how to best delegate this task back to SharePoint. 
I would really appreciate some clear guidance on this - talk to me like I'm 9 😆.

 

Thanks in advance. 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Walter_Wego ,

As per Microsoft Last is Non- Delegable Function but it will show the Warning message if Row crosses the limit ,

So you can follow the below steps to increase the Count but (Keep in mind - you can set upto 2000 Max).

Click on File Tab, 

VijayTailor_1-1602826523378.png


Navigate the Yellow Highlighted and increase the limit,
 

VijayTailor_0-1602826458473.png

For More details about  Function Last see the below url.
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

Thanks,
Vijay

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

View solution in original post

3 REPLIES 3
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Walter_Wego ,

As per Microsoft Last is Non- Delegable Function but it will show the Warning message if Row crosses the limit ,

So you can follow the below steps to increase the Count but (Keep in mind - you can set upto 2000 Max).

Click on File Tab, 

VijayTailor_1-1602826523378.png


Navigate the Yellow Highlighted and increase the limit,
 

VijayTailor_0-1602826458473.png

For More details about  Function Last see the below url.
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

Thanks,
Vijay

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

v-siky-msft
Community Support
Community Support

Hi @Walter_Wego ,

 

Does this code make sense for your case?

If(EditForm1.Mode = FormMode.New, 
Last(Sort(Filter(Car_pool_logs,Vehicle = TextInput1.Text), 'KMS at end' ,Ascending)).'KMS at end',Parent.Default)

 Hope this helps.

Sik

Thanks @v-siky-msft ,

I appreciate the effort. Unfortunately it still comes up with the delegation warning. I think it is sadly the case that @VijayTailor has mentioned - I cant use 'Last' in delegation. 

 

Thanks for the responses. 

Can I ask one question for clarity - If I filter the gallery based on another column (office location) - will I then be able to use the 'Last' filter that we have been discussing on a reduced row count?

 

in other words if I use a global filter on the gallery, can I then further filter the results using my non delegated filter?

 

I hope that makes sense and thanks for your help!

 

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,825)