In flow, I want to count the number of attachments in an email(outlook) and save in a excel or may be sharepoint. The table will only have the Date and Count the number of attachments fields. Can anyone help me how to make a Power automate flow??? I am new to Power automate???
YOu don't need a loop. Just do the filter array and then length of the result
Thank you so much for the prompt reply. I have pasted my screen to understand if I'm doing it correctly. But After doing this still, the count is not taking only PDFs. Tried using Content type, file attachment and attachments only but nothing seems to be working.
After retrieving the files use filter array actions for each type to filter out all the files you don't want to count. Then use Length() on the resulting array to get the number of files.
Thank you for being so helpful Pstork1 , how do incorporate the requirements of specific Extention of the file we need? What you wrote absolutely makes sense but I'm just starting my journey in doing this flow creation so do not know how to and what to do in steps while generating this result of counts. May I request you show me how to make it possible?
If you want to run it on a schedule, then the trigger needs to be a recurrence trigger. Once the trigger fires you'll need to do a Get Emails. This should be filtered so only emails with attachments received within the last 24 hours are retrieved. Now that you have the emails you'll need to process each email by getting the attachments, counting the attachments with the extensions you want and incrementing a counter variable.
there are certain changes in the flow.
1.The flow run at schedule time(9:00 am) in the morning. It should count the number of attachments in the last 24 hours. How I implement this logic?
2. We need to count the number of attachments only certain files(.txt & .csv). Ignore all the other attachments.
3.Which trigger I need to use??? I think I need to use "Export Email"??? Is it right??? If something else, please let me know.
The formula should be the right one. Do you use any icons or anything in your signature? Those will also be counted as attachments in the email.
The date and time that the email was received is included as dynamic content. But if you want to filter based on the date and time then you will need either a condition or a filter array.
Is the right formula to get the number of attachments. As it is not producing the correct result. When I put 2 attachments, the compose function is producing output as 3. Can you let me know what is the correct formula.
Regarding Received Time(Date & Time email), I need to use condition. Is there any way I get received time without the use of Condition???
If all you want is to get the number of attachments and the date then you don't need any Apply to Each loops. Also in the compose you need to use the Expressions tab of the dynamic content dialog box to add the length() function. The date and time the email arrived is already available from the trigger as Received Time.