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

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (145)