cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emckinney81
Advocate V
Advocate V

show last time an action was performed

I have a scenario where I am performing a set of tasks weekly, as such one of the tasks is taking a survey for each customer.  I want to show the last time the survey was taken for each tasks, by customer.  There are three seperate tables, Customers table, Tasks Table, and then the Details table which  is where the results land including a survey short date.  My app is laid out like this; Gallery of customers, then based on the customer you select you get their assigned tasks (This is where i want to show the last date the task was performed), which i need to pull from the details table. 

 

The wierd thing is, I do have this working, but by doing a number of collections and then single column collections, I feel like there is a more efficient way of doing this by creating a temp table with some sort to formula to pull the latest date. I am just striking out creating a collection and adding columns. Looking for anyone who has some advice or is trying to do the same. 

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User II
Super User II

Hi Eric!

 

Just going through and cleaning up older unanswered topics. I know you will have solved this already back in 2017 but If anyone is viewing this now due to a google search and wants an answer to their similar problem then:

 

Yes, there is always a better way to do things! 🙂

 

In this case, I would use a filtered LastN function to only bring back the last created record for that particular task.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-first-last

 

Something like:
LastN( Filter(datasource, taskID = ThingGallery.Selected.ID), 1)

 

This will get you the singular last created record, you could add additional filtering options to narrow it down further.

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

1 REPLY 1
iAm_ManCat
Super User II
Super User II

Hi Eric!

 

Just going through and cleaning up older unanswered topics. I know you will have solved this already back in 2017 but If anyone is viewing this now due to a google search and wants an answer to their similar problem then:

 

Yes, there is always a better way to do things! 🙂

 

In this case, I would use a filtered LastN function to only bring back the last created record for that particular task.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-first-last

 

Something like:
LastN( Filter(datasource, taskID = ThingGallery.Selected.ID), 1)

 

This will get you the singular last created record, you could add additional filtering options to narrow it down further.

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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