cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jfielder
Frequent Visitor

Daily Summary Email Send email if array isn't empty

Good Afternoon,

I've tried numerous different posts and blog posts and can't find an answer that works.

I have a flow to send a summary email of items posted to a document library every 12 hours. The Flow works however I want to add a condition of if the array or HTML table (not sure which I should use) is empty to not send the email. Below is the latter half of my flow.

Summary Flow.png

5 REPLIES 5
tom_riha
Super User
Super User

Hello @jfielder ,

looking at your flow, you get an array of files by 'Get files (properties only)', then you 'Filter array' to filter only some of the files, but then in the 'Select' you use the full array from 'Get files...' again, ignoring the filtering done in the 'Filter array'.

But to your question, if you want to check if there's any document left after the 'Filter array' action, you should check the 'Body' output of the 'Filter array' before the 'Select'. I prefer to use length(...) expression for that, it'll give you length of an array. If the length is equal to 0, the array is empty, do nothing. If it's more than 0, it contains some items, you can continue with the 'Select', 'Create HTML table' and the email.

image.png 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

thanks @tom_riha that's not seeming to work... here is my full flow now...

bulletin flow.png

@jfielder can you store the array you use in the length(...) expression in a 'Compose' action just before the 'Condition', and confirm that the array value is [] (it's an empty array)?



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

sorry it has been so long @tom_riha can you advise more how i do this? maybe a screenshot? 

Hello @jfielder ,

like this:

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,427)