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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to read older emai...
Power Automate
Unanswered

How to read older emails first with Office 365 Outlook Get emails (V3) operation?

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm using Office 365 Outlook Get emails (V3) to read emails from my inbox. I'm reading 3 emails by execution.

 

By default, the flow process the emails from the newest to the oldest. But I would like to process the older emails first.

 

I don't see any option to apply in the operation? How can I achieve this?

 

ARAG_0-1639394365873.png

 

Thank you

Categories:
I have the same question (0)
  • v-chenzhi Profile Picture
    on at

    Hi @ARAG ,

     

    Get email(V3) does not have the function of sorting email dates.

    I have an alternative, please try the following work around.

    vchenzhi_0-1639546062277.png

    1:length(variables('TT'))
    
    2:length(outputs('Get_emails_(V3)')?['body/value'])
    
    3:take(outputs('Get_emails_(V3)')?['body/value'],sub(length(outputs('Get_emails_(V3)')?['body/value']),length(variables('TT'))))
    
    4:last(outputs('Compose'))
    

    The array variable TT contains emails from oldest to newest.

     

     

    Best Regards,

    Zhi Chen

  • VictorIvanidze Profile Picture
    13,073 on at

    Use a GRAPH request

    https://graph.microsoft.com/v1.0/me/messages?$orderby=receivedDateTime

    instead of "Get emails (V3)" action.

  • Community Power Platform Member Profile Picture
    on at

    it gives an error on append to array variable.

    the error says : BadRequest. The value cannot be null. The action type 'AppendToArrayVariable' only supports values of types 'Float, Integer, String, Boolean, Object'

    Nikhilsthorat03_0-1648047233827.png

    Please can you help me fix this. Thanks!

  • jessdom3 Profile Picture
    29 on at

    What type of operation step do you add to make a graph request? When I search Graph I only get Microsoft Graph Security. 

  • VictorIvanidze Profile Picture
    13,073 on at

    "Send a HTTP request" action of "Office 365 Groups" connector.

  • jessdom3 Profile Picture
    29 on at

    What if the mailbox being connected to is not tied to an Office 365 Group? Does that matter? We are trying to pull email for a shared mailbox.

  • VictorIvanidze Profile Picture
    13,073 on at

    You have to change the request then:

    https://graph.microsoft.com/v1.0/{sharedmbxid}/messages?$orderby=receivedDateTime

    Play with GRAPH Explorer a bit before creating the flow.

  • jessdom3 Profile Picture
    29 on at

    OK I figured out the graph http request, but how do I parse through the results? Is there a how-to somewhere I can follow?

  • VictorIvanidze Profile Picture
    13,073 on at

    Sorry I don't understand your problem. The request returns the array of message objects. Handle them as you like.

  • jessdom3 Profile Picture
    29 on at

    I'm not super familiar with ms graph so I am probably doing something wrong or missing something in my HTTP request. When I try to parse the results, the only info from the HTTP request available to me is "body", which means I can't filter the results on any particular attribute.

     

    jessdom3_0-1666192829089.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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard