web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help with Powerap...
Power Apps
Answered

Need help with Powerapps Max Date

(0) ShareShare
ReportReport
Posted on by 206

I have a sharepoint list.  It allow supervisors to make team assignments each morning.  This helps us track accountability for each person on that team.  I do not want to give them EDIT permission to the data table in the powerapp (sharepoint back end-  See screen shot  attached), as a bad actor could alter the driver assigned in the afternoon to help an ally or themselves avoid accountability for a vehicle issue, for example.

 

The power app allows them to ADD a record, and a different screen and button allows them to review what they have entered.

I am considering allowing the user / power app add a duplicate, corrected entry for that team color, if the teammate initially keys in the wrong team assignment.

 

This now gives me an issue to solve for: 

RedTeam Vehicle #1 created 12/17/2020 @ 7:00AM

RedTeam Vehicle #1 created 12/17/2020 @ 7:05AM with different team assignments

 

At 7:45 AM each day, these team assignments get pushed (via a Flow) to Microsoft Teams channel for that red team,for example ,and the team will post any issues, photos of any issues, etc in the new conversation that FLow created

 

How can I return only the latest Team color entry for a given day using the max of the created field. 

 

I will need to solve for this both in my flow, and the data table view that is shown for the supervisor to verify their entries.  

 

For the table review, I use this in the items section : Filter(DailyTeams,Today() <= WorkDate) and this works fine, but will show a duplicate for RED team if I allow it.  This needs  to show only the max records for each team color.

 

My FLow has this in the sharepoint get items section, and it works great today:  
Created gt '@{addDays(utcnow('yyyy-MM-ddTHH:mm:ssZ'), -1)}' and TeamColors eq 'Red'

I would need to account for a situation if duplicates are keyed in for a given team, so need the max if the team color, and created date here a well.

 

Thanks!

 

Capture.JPG
Capture2.JPG
Categories:
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @MrAutomate 

    I like to use First(Sort(spList, datefield, Descending)).TeamColor for example.  If there are >2000 items, then it will still work.  Max() and Last() are not delegatable in SharePoint and will not give the correct value if the maximum number of items allowable is exceeded. First(Sort( Descending will select the last record in the list regardless of the size of the list and tacking on .field will show the field value for that record.  The list can even be filtered first since Sort and Filter are delegatable functions in SharePoint. 

  • MrAutomate Profile Picture
    206 on at

    I seem to have forgotten to drop you a thank you note.  It was very helpful! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard