cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Get emails (V3) - count unread / bypass 25 limit

Hi,

 

I tried to do this myself but I cannot find any solution on the internet.

 

I have the following situation:

I want to monitor the actual number of unread e-mails of multiple inboxes. The total number from each user can be pushed to a Teams channel or updated inside a share point Excel file, but that is not my problem. The users usually have more than 25 unread so I have a problem with the "Get emails" limitation of 25.

 

I was thinking if there maybe is some function that I couldn't find that will just "read" the total number of unread mails in the inbox and provide this number.

If that is not possible my idea would be to create a flow which will "count" the individual message IDs of all unread mails in the inbox. But I don't know how to make a flow which will execute this action.

 

If you think there is a way to do it - please share it with me. Your help is very much appreciated.

@AKRogers I saw a different thread where you were working with message IDs in a somewhat related case, maybe you can help? 🙂

 

Thanks in advance,

Seba

32 REPLIES 32
leoU
Frequent Visitor

Thank you Sam, your codes work like a charm.....

leoU
Frequent Visitor

Thank you Sam, this works for me!

This is not true, please check @Sam-  codes for solution!

jazzen17
Regular Visitor

Hi,

Can someone help me also? i am creating a flow that retrieves all the attachment from a certain email and delete it after i retrieved it. But it has the 25 only limit, is there a workaround on it? Thanks!

leoU
Frequent Visitor

Use @Sam-  code; it works. 

Can you show the complete flow? it seems like some inner data is missing @fehann 

MarcDELMOTTE
New Member

I had the same problem when exporting 5000 emails to Access for big data analysis.
1. Ask to see all emails ("Click here to see more Ms Exchange items" - translated from french)
2. Ctrl+A to select all emails
3. Fix the selection with Copy Ctrl+C
4. Open the Import-Export Wizard and select Export to File (PST)
5. When done, File-Open this file in your Outlook
You can now do whatever you want, even import it into an Access table...
Marc - C.I.A. Informatique (Belgium)

S4m33r
Regular Visitor

@MarcDELMOTTE 
Bonjour Marc

 

You posted your reply in the wrong section I believe.
This is/was about automating a task.

 

Thanks

Hey @fehann,

Just wanted to drop a quick message to say thanks for your post that helped me save a bunch of time storing email attachments from a year ago on OneDrive. Your idea was a real lifesaver!

 

If you don't mind, I wanted to share a couple of comments that might help other folks out in the future.

 

First off, the DO UNTIL Action expression isn't visible in the screenshot you posted, but it can be constructed using the Expression builder with the syntax:

length(variables('ListEmails'))

 

Secondly, even if you try to avoid the TOP 25 emails, the GET EMAILS (V3) Action has a limit of 250 emails, as noted on the support page:

"Please note that filtering related to these fields: To, Cc, To Or Cc, From, Importance, Fetch Only With Attachments, Subject Filter, is performed using first 250 items in a given mail folder. To avoid that limitation you can use 'Search Query' field."

 

To get around this limit, you can use the "search" property in the SEARCH QUERY field. An example of an expression that worked for my search criteria was:

 

(from:email_1@email.com OR from:email_2@email.com) AND subject:Sales AND hasAttachment:true AND isRead:false AND received>=@{formatDateTime(addDays(utcNow(),-365),'yyyy-MM-dd')} AND received<=@{formatDateTime(utcNow(),'yyyy-MM-dd')}

 

the @{formatDateTime(addDays(utcNow(),-365),'yyyy-MM-dd')} parts can be written using the Expression builder

 

Thanks again for the great post!

Hi there, 

Sorry for replying a a message 2 years later but could you please provide some details on how you've done that in power automate? Any screenshots? I understand the idea of using Graph API to request unread emails but I am not sure how to implement that.

Hi @testing_testing ,

 

I'll try to help but I'm not quite what part of the process you're interested in.  I have attached a big-A$$ed screenshot of my solution's flow that contains the mailbox GetMessages looping to extract the info for all emails in a mailbox folder.  Be aware that a mailbox contains the inbox folder and many more folders (e.g. Trash) and possibly sub-folders.  Thus, because my flow is dealing with which mailbox folder to target and extracting it and possibly all its subfolder(s)'s emails, it makes this a bit overwhelming if you're just trying to focus on a sub part.  So, why don't you look over the flow screenshot and then provide some questions detailing the specific area/functionality you are interested in?

 

Just for context, this flow is launched by an HTTP request which provides some parameters used to alter the flow behavior (e.g. which employee's mailbox to target, which folder in that mailbox to target).  For dev, I suggest you skip that and just set the variables directly....but in the screenshot you'll see my vars are getting set by referencing the http trigger parameters.  So I wanted to warn you about that possible puzzling thing.  Anyway....the flow then focuses on zeroing in on the targeted emails and looping through all of them by "chunking" the getEmails requests/responses into "batches" until it has chewed through them all.

 

The goal being to extract properties for each email which are used to:

 

1) record the data in a SQL database (for outside auditing/logging/data-analysis)

2) to invoke a child flow that generates and outputs a PDF of each email along with the contents of any ("PDF-able") attachments on that email.

 

I have not expanded those scopes to try and keep this manageable for the discussion here.

 

The main thing to note in the expanded area is all the nested looping and number calcs as the flow tries to determine how many messages it retrieved with the response from the GraphAPI endpoint, if there are more emails still to retrieve (aka another page/chunk of messages), and if the number processed so far meets the run-limits set by the invocation parameters.

 

Hope this helps.  It can be daunting at first but once you master using the GraphAPI, it's almost like having super-powers compared to the built-in "no-code/low-code/citizen develop" connectors/actions.  Good luck!

 

Oh, keep in mind that permissions to the mailbox must be properly configured to allow this access to work.  As one would expect, you can't just start reading people's mailboxes if they or an Exchange or Azure admin hasn't properly configured access.  If you don't have "sway" over or direct control of such areas/people, you may be unable make this viable for anything beyond your own mailbox.  A work around (or for testing purposes) is to have a user or admin extract a mailbox as a PST file and then import that PST into a mailbox you have access to into a new subfolder in your inbox.  I suggest starting with that before getting into the technical and political "challenges" of security configuration of other employees' mailboxes.

@Sam- : I try to follow your documentation and fail.

 

Initial situation:
I have a folder for each company in my email database and manually sort relevant emails into the respective folders.
For example, I sort emails sent to Microsoft and emails received from Microsoft in the "MICROSOFT.COM" folder. I have several hundred of these folders.
I move less relevant emails to an "Archive" folder. I have accumulated ~40,000 e-mails there. Now I would like to sort these emails automatically, if possible.

 

Here I have the following challenges:

  1. power automate desktop is extremely cumbersome and also not "cloud first".
  2. power automate cloud
    1. i can't seem to enter "*@microsoft.com" as the sender or recipient in the "Get emails (V3)" action.
    2. i fail at the 25 email limit
    3. i do not manage to implement your documentation.

 

AJD_MT_3-1712603280403.png

 

AJD_MT_4-1712603341372.png

 

AJD_MT_5-1712603486160.png

 

AJD_MT_6-1712603640867.png

 

AJD_MT_10-1712605621522.png

 

AJD_MT_11-1712605645669.png

 

AJD_MT_12-1712605659187.png

 

AJD_MT_14-1712605969055.png

 

 

AJD_MT_15-1712606476199.png

 

 

 

 

 

VictorIvanidze
Community Champion
Community Champion

Try to switch to the "old" flow editor.

 

Also have a look at this: https://ivasoft.com/countemailsflow.shtml

________________________________________________________

Welcome to my web site.

Helpful resources

Announcements

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Tuesday Tip: Subscriptions & Notifications

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week: All About Subscriptions & Notifications We don't want you to a miss a thing in the Community! The best way to make sure you know what's going on in the News & Announcements, to blogs you follow, or forums and galleries you're interested in is to subscribe! These subscriptions ensure you receive automated messages about the most recent posts and replies. Even better, there are multiple ways you can subscribe to content and boards in the community! (Please note: if you have created an AAD (Azure Active Directory) account you won't be able to receive e-mail notifications.)   Subscribing to a Category  When you're looking at the entire category, select from the Options drop down and choose Subscribe.     You can then choose to Subscribe to all of the boards or select only the boards you want to receive notifications. When you're satisfied with your choices, click Save.     Subscribing to a Topic You can also subscribe to a single topic by clicking Subscribe from the Options drop down menu, while you are viewing the topic or in the General board overview, respectively.     Subscribing to a Label Find the labels at the bottom left of a post.From a particular post with a label, click on the label to filter by that label. This opens a window containing a list of posts with the label you have selected. Click Subscribe.     Note: You can only subscribe to a label at the board level. If you subscribe to a label named 'Copilot' at board #1, it will not automatically subscribe you to an identically named label at board #2. You will have to subscribe twice, once at each board.   Bookmarks Just like you can subscribe to topics and categories, you can also bookmark topics and boards from the same menus! Simply go to the Topic Options drop down menu to bookmark a topic or the Options drop down to bookmark a board. The difference between subscribing and bookmarking is that subscriptions provide you with notifications, whereas bookmarks provide you a static way of easily accessing your favorite boards from the My subscriptions area.   Managing & Viewing Your Subscriptions & Bookmarks To manage your subscriptions, click on your avatar and select My subscriptions from the drop-down menu.     From the Subscriptions & Notifications tab, you can manage your subscriptions, including your e-mail subscription options, your bookmarks, your notification settings, and your email notification format.     You can see a list of all your subscriptions and bookmarks and choose which ones to delete, either individually or in bulk, by checking multiple boxes.     A Note on Following Friends on Mobile Adding someone as a friend or selecting Follow in the mobile view does not allow you to subscribe to their activity feed. You will merely be able to see your friends’ biography, other personal information, or online status, and send messages more quickly by choosing who to send the message to from a list, as opposed to having to search by username.

Monthly Community User Group Update | April 2024

The monthly Community User Group Update is your resource for discovering User Group meetings and events happening around the world (and virtually), welcoming new User Groups to our Community, and more! Our amazing Community User Groups are an important part of the Power Platform Community, with more than 700 Community User Groups worldwide, we know they're a great way to engage personally, while giving our members a place to learn and grow together.   This month, we welcome 3 new User Groups in India, Wales, and Germany, and feature 8 User Group Events across Power Platform and Dynamics 365. Find out more below. New Power Platform User Groups   Power Platform Innovators (India) About: Our aim is to foster a collaborative environment where we can share upcoming Power Platform events, best practices, and valuable content related to Power Platform. Whether you’re a seasoned expert or a newcomer looking to learn, this group is for you. Let’s empower each other to achieve more with Power Platform. Join us in shaping the future of digital transformation!   Power Platform User Group (Wales) About: A Power Platform User Group in Wales (predominantly based in Cardiff but will look to hold sessions around Wales) to establish a community to share learnings and experience in all parts of the platform.   Power Platform User Group (Hannover) About: This group is for anyone who works with the services of Microsoft Power Platform or wants to learn more about it and no-code/low-code. And, of course, Microsoft Copilot application in the Power Platform.   New Dynamics365 User Groups   Ellucian CRM Recruit UK (United Kingdom) About: A group for United Kingdom universities using Ellucian CRM Recruit to manage their admissions process, to share good practice and resolve issues.    Business Central Mexico (Mexico City) About:  A place to find documentation, learning resources, and events focused on user needs in Mexico. We meet to discuss and answer questions about the current features in the standard localization that Microsoft provides, and what you only find in third-party locations. In addition, we focus on what's planned for new standard versions, recent legislation requirements, and more. Let's work together to drive request votes for Microsoft for features that aren't currently found—but are indispensable.   Dynamics 365 F&O User Group (Dublin) About: The Dynamics 365 F&O User Group - Ireland Chapter meets up in person at least twice yearly in One Microsoft Place Dublin for users to have the opportunity to have conversations on mutual topics, find out what’s new and on the Dynamics 365 FinOps Product Roadmap, get insights from customer and partner experiences, and access to Microsoft subject matter expertise.  Upcoming Power Platform Events    PAK Time (Power Apps Kwentuhan) 2024 #6 (Phillipines, Online) This is a continuation session of Custom API. Sir Jun Miano will be sharing firsthand experience on setting up custom API and best practices. (April 6, 2024)       Power Apps: Creating business applications rapidly (Sydney) At this event, learn how to choose the right app on Power Platform, creating a business application in an hour, and tips for using Copilot AI. While we recommend attending all 6 events in the series, each session is independent of one another, and you can join the topics of your interest. Think of it as a “Hop On, Hop Off” bus! Participation is free, but you need a personal computer (laptop) and we provide the rest. We look forward to seeing you there! (April 11, 2024)     April 2024 Cleveland Power Platform User Group (Independence, Ohio) Kickoff the meeting with networking, and then our speaker will share how to create responsive and intuitive Canvas Apps using features like Variables, Search and Filtering. And how PowerFx rich functions and expressions makes configuring those functionalities easier. Bring ideas to discuss and engage with other community members! (April 16, 2024)     Dynamics 365 and Power Platform 2024 Wave 1 Release (NYC, Online) This session features Aric Levin, Microsoft Business Applications MVP and Technical Architect at Avanade and Mihir Shah, Global CoC Leader of Microsoft Managed Services at IBM. We will cover some of the new features and enhancements related to the Power Platform, Dataverse, Maker Portal, Unified Interface and the Microsoft First Party Apps (Microsoft Dynamics 365) that were announced in the Microsoft Dynamics 365 and Power Platform 2024 Release Wave 1 Plan. (April 17, 2024)     Let’s Explore Copilot Studio Series: Bot Skills to Extend Your Copilots (Makati National Capital Reg... Join us for the second installment of our Let's Explore Copilot Studio Series, focusing on Bot Skills. Learn how to enhance your copilot's abilities to automate tasks within specific topics, from booking appointments to sending emails and managing tasks. Discover the power of Skills in expanding conversational capabilities. (April 30, 2024)   Upcoming Dynamics365 Events    Leveraging Customer Managed Keys (CMK) in Dynamics 365 (Noida, Uttar Pradesh, Online) This month's featured topic: Leveraging Customer Managed Keys (CMK) in Dynamics 365, with special guest Nitin Jain from Microsoft. We are excited and thankful to him for doing this session. Join us for this online session, which should be helpful to all Dynamics 365 developers, Technical Architects and Enterprise architects who are implementing Dynamics 365 and want to have more control on the security of their data over Microsoft Managed Keys. (April 11, 2024)       Stockholm D365 User Group April Meeting (Stockholm) This is a Swedish user group for D365 Finance and Operations, AX2012, CRM, CE, Project Operations, and Power BI.  (April 17, 2024)         Transportation Management in D365 F&SCM Q&A Session (Toronto, Online) Calling all Toronto UG members and beyond! Join us for an engaging and informative one-hour Q&A session, exclusively focused on Transportation Management System (TMS) within Dynamics 365 F&SCM. Whether you’re a seasoned professional or just curious about TMS, this event is for you. Bring your questions! (April 26, 2024)   Leaders, Create Your Events!    Leaders of existing User Groups, don’t forget to create your events within the Community platform. By doing so, you’ll enable us to share them in future posts and newsletters. Let’s spread the word and make these gatherings even more impactful! Stay tuned for more updates, inspiring stories, and collaborative opportunities from and for our Community User Groups.   P.S. Have an event or success story to share? Reach out to us – we’d love to feature you. Just leave a comment or send a PM here in the Community!

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

We have closed kudos on this post at this time. Thank you to everyone who kudo'ed their RSVP--your invitations are coming soon!  Miss the window to RSVP? Don't worry--you can catch the recording of the meeting this week in the Community.  Details coming soon!   *****   It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Users online (3,305)