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 Automate / #Filter the array base...
Power Automate
Answered

#Filter the array based on the latest date

(0) ShareShare
ReportReport
Posted on by

Hi There,

I need some support to filter the array based on the latest date.

 

Sample Array: 

 

Spoiler (Highlight to read)

[

{
"ParentID":"CRQ000030752389",
"Attachment Name":"updated DP.xlsx",
"WorkInfoSubmitDate":"2023-07-03T15:29:48+02:00",
"WorkInfoSummary":"DP Updated"
},

{
"ParentID":"CRQ000030752389",
"Attachment Name":"Blank",
"WorkInfoSubmitDate":"2023-06-03T13:24:45+02:00",
"WorkInfoSummary":"This ticket was created from the service request system."
},

{
"ParentID":"CRQ000030752389",
"Attachment Name":"DP.xlsx",
"WorkInfoSubmitDate":"2023-05-03T12:12:30+02:00",
"WorkInfoSummary":"DP Attached"
}

]

[{"ParentID":"CRQ000030752389","Attachment Name":"updated DP.xlsx","WorkInfoSubmitDate":"2023-07-03T15:29:48+02:00","WorkInfoSummary":"DP Updated"},{"ParentID":"CRQ000030752389","Attachment Name":"Blank","WorkInfoSubmitDate":"2023-06-03T13:24:45+02:00","WorkInfoSummary":"This ticket was created from the service request system."},{"ParentID":"CRQ000030752389","Attachment Name":"DP.xlsx","WorkInfoSubmitDate":"2023-05-03T12:12:30+02:00","WorkInfoSummary":"DP Attached"}]

Required Output Array: 

 

Spoiler (Highlight to read)

[

{
"ParentID":"CRQ000030752389",
"Attachment Name":"updated DP.xlsx",
"WorkInfoSubmitDate":"2023-07-03T15:29:48+02:00",
"WorkInfoSummary":"DP Updated"
}

]

[{"ParentID":"CRQ000030752389","Attachment Name":"updated DP.xlsx","WorkInfoSubmitDate":"2023-07-03T15:29:48+02:00","WorkInfoSummary":"DP Updated"}]

Regards,

RK

Categories:
I have the same question (0)
  • Verified answer
    Mitanshu Profile Picture
    1,656 Moderator on at

    1 - Sort Array and reverse the order so you get latest date as first element of the array

    2 - Get the first element of the array

     

    first(reverse(sort(outputs('SampleInput'),'WorkInfoSubmitDate')))

     

    happyume_0-1691495670024.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    CU-21081200-1 Profile Picture
    on at

    Hi happyume 😀

     

    Its a perfect solution...You are a 🌟

     

    Thank you so much God bless You 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard