cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sega2
Helper II
Helper II

Get flagged emails in Automate

Is it possible for a flow wo get all flagged emails, and unmark them a flagged?

 

Best R, Thomas

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @sega2,

 

You could use the Graph API to retrieve flagged e-mails via an HTTP action. This does require the setup of an app registration in Azure AD and the correction Graph API permission. Lee Ford has written a good blog about this app reg setup: https://www.lee-ford.co.uk/using-flow-with-graph-api/

 

The Graph API query you could use would be:

https://graph.microsoft.com/v1.0/me/messages?select=flag&filter=flag/flagStatus eq 'flagged'

 

This is based on the List messages method:

https://docs.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&tabs=http

 

For each item in that response you could update the flagged status by using the flag a email action.

notflagged.png 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @sega2,

 

You could use the Graph API to retrieve flagged e-mails via an HTTP action. This does require the setup of an app registration in Azure AD and the correction Graph API permission. Lee Ford has written a good blog about this app reg setup: https://www.lee-ford.co.uk/using-flow-with-graph-api/

 

The Graph API query you could use would be:

https://graph.microsoft.com/v1.0/me/messages?select=flag&filter=flag/flagStatus eq 'flagged'

 

This is based on the List messages method:

https://docs.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&tabs=http

 

For each item in that response you could update the flagged status by using the flag a email action.

notflagged.png 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Thanks appreciated.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,587)