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 / Count number of emails...
Power Automate
Unanswered

Count number of emails recieved and emails sent

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

I am trying to build an automated flow that count the emails that arrives in a shared mailbox, and the emails sent from the same mailbox in order to track the activity.  

 

I tried to build the flow, and in regards to emails arriving I was looking at https://powerusers.microsoft.com/t5/Building-Flows/Count-the-number-of-emails-received-in-a-day-via-sharepoint-list/td-p/117542. 

This gave an error though, and I believe it is because I need to do something about my sharepoint list. 

Excellist.PNG

fail.PNG

Any idea to changes I need to doto get emails recieved flow working and how I can count the emails sent? 

Categories:
I have the same question (0)
  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @Christian8 

    Can you share your FLow configuration (Screen shot) please? and confirm which action is generating the error?

    Thanks J

  • Christian8 Profile Picture
    4 on at

    Hi, 

    Thank you for your response.

    See below screenshots for flow so far. It is "get item" that fails with the screenshot in the first post. The second part of the problem counting the amount of sent items I am not sure if flow can handle? There is not function called "When a new emails is sent from a shared mailbox"

     flow1.PNG

    flow2.PNG

  • Jay-Encodian Profile Picture
    2,920 on at

    Hi @Christian8 

    You're using the SharePoint 'Get Item' action to retrieve an item from the 'Mail Tracker' list with an ID of 1... so every time the Flow's runs it would always try to obtain that list item which I'm guessing doesn't exist ... hence the 404 error.

    Have you verified that the item with an ID of 1 exists in the list?

    HTH

    Jay

     

  • Christian8 Profile Picture
    4 on at

    Hi Jay, 

     

    I believe you are right, but inserting 1 in a cell does not solve the issue, just causing a new one.

    I am new to ms flow, but I would very much like to learn. 

    Is there a way (on a daily basis) to count the number of mails arriving at a mailbox, and the number sent from the mailbox using MS flow? 

     

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

    Hey @Christian8 

    You can query the graph to obtain this data, albeit this a slightly more complex approach as you'll need to manage authentication, HTTP request / response, etc. - see https://docs.microsoft.com/en-us/graph/api/reportroot-getemailactivityusercounts?view=graph-rest-1.0&tabs=http

    Your current Flow isn't to far away from recording email activity, but you need to make a decision on how you wish to record the data as this will affect how you store the data in SharePoint... if it's simply a total count then you can just add a single list item, and increment every time an email is received... if you need a daily, weekly, monthly count etc. then you'll need to create a list item for every mail received, you can then use the 'SharePoint Get Items' action and use the 'Filter Query' to return the items which meet the time-frame criteria (1 day, week, etc)... finally just check the length of the returned array.

    Finally, I don't think you can record emails sent in this way as there isn't a Flow trigger for sent email.

    I'd suggest querying the graph is probably the best solution.

    HTH

    Jay

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard