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 Automate
Answered

SORT HTTP_EMAILS

(0) ShareShare
ReportReport
Posted on by 108

 

Hello all

i am using https://graph.microsoft.com/v1.0/me/messages?$top=1000 to get top 1000 emails..

 

Can I sort this output based on Received date.. 

 

Categories:
  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @krishnakumar_R ,

    I think that the easiest way is to delegate this task to Exchange online server with a Graph call like:

     

    https://graph.microsoft.com/v1.0/me/messages?$top=100&orderBy=receivedDateTime asc

     

     Hope it helps !

  • krishnakumar_R Profile Picture
    108 on at

     https://graph.microsoft.com/v1.0/me/messages?$top=1000

     

    Can we take bottom 100 like Top 1000

  • Verified answer
    VictorIvanidze Profile Picture
    13,083 on at

    No.

  • Verified answer
    krishnakumar_R Profile Picture
    108 on at

    Microsoft must think all options 🙂

    thanks @VictorIvanidze 

  • krishnakumar_R Profile Picture
    108 on at

    https://graph.microsoft.com/v1.0/me/messages?$orderby=receivedDateTime desc & $filter=receivedDateTime gt 2023-03-22T00:00:00Z

    how can we code date as todays date? (Red color need to be current date).  Share any links, I can refer please 

    @VictorIvanidze 
    @gabibalaban 

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    There is no need for the second $ char, also it is recommended to use filter as first element in query: 

    https://graph.microsoft.com/v1.0/me/messages?$filter=receivedDateTime gt 2023-03-21T00:00:00Z & orderby=receivedDateTime desc
  • krishnakumar_R Profile Picture
    108 on at

     

    something like this.. This is failing

    krishnakumar_R_0-1679486308294.png

     

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @krishnakumar_R ,

    In compose 2, use dateTimeFormat(utcNow(),'yyyy-MM-ddT00:00:00Z') and in URI - only Outputs of compose.

  • krishnakumar_R Profile Picture
    108 on at

    Not sure what is wrong

    krishnakumar_R_0-1679500697690.png

     

    https://graph.microsoft.com/v1.0/me/messages?$orderby=receivedDateTime desc & $filter=receivedDateTime lt addDays(utcNow(),+0,'yyyy-MM-ddT00:00:00Z')

    krishnakumar_R_1-1679500907360.png

     

  • Verified answer
    krishnakumar_R Profile Picture
    108 on at

    i found out.. I hardcoded the value in compose statement.. I should have come via Dynamic Expression 

     

    krishnakumar_R_0-1679544295116.png

     

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 Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard