cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Charles-v-D
Level: Powered On

How to determine the size (Mb) of an attachment in MS Flow

Hi all,

 

I just had one of my flows "fail" due to the fact that the attachment to an e-mail exceeded the 5Mb size. I want to build in a check to prevent this from happening. How can I determine the combined size of all attachments of a SharePoint List item?

 

Any feedback is welcome!

 

Regards

Charles

 

1 ACCEPTED SOLUTION

Accepted Solutions
DeepakS
Level 10

Re: How to determine the size (Mb) of an attachment in MS Flow

Hi @Charles-v-D 

 

Following Expression (approx) will give you the file size:

 KB =  div(int(length(string(body('Get_file_content')))),1024)  (Preferred)

MB = div(int(length(string(body('Get_file_content')))),1048576)

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
DeepakS
Level 10

Re: How to determine the size (Mb) of an attachment in MS Flow

Hi @Charles-v-D 

 

Following Expression (approx) will give you the file size:

 KB =  div(int(length(string(body('Get_file_content')))),1024)  (Preferred)

MB = div(int(length(string(body('Get_file_content')))),1048576)

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Charles-v-D
Level: Powered On

Re: How to determine the size (Mb) of an attachment in MS Flow

@DeepakS Thanks Deepak! Works like a charm!

 

regards

charles

 

 

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,946)