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
Super User

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
Super User

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (2,193)