cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OlafBond
New Member

Saving Gmail attachments based on their size and type

I have flows that save attachments from my Gmail account. A lot of useless files are saved.
Please help me to adjust the flows so only big enough files with proper extensions would be saved.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @OlafBond 

I set up a flow, you can refer to below screenshots.

Assume the file is pdf or docx and the size exceeds 50kb, the attachment will be saved.

vLilyWmsft_1-1643251708070.png

Add a judgment condition, if the file is pdf or docx and the size exceeds 50kb, the attachment will be saved.

You can modify it according to your actual needs

vLilyWmsft_10-1643254135457.png

Expression:

div(items('Apply_to_each')?['Size'],1024)

vLilyWmsft_11-1643254153088.png

vLilyWmsft_8-1643252868616.png

Save and test the flow.

When I receive an email like below.

vLilyWmsft_5-1643252374257.png

After flow runs, test7.8-1 will be created in my Google Drive.

vLilyWmsft_9-1643254020970.png

Hope the content above may help you.

Best Regards

If my answer helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Guriga
Advocate II
Advocate II

Hi,

Can you share the screenshot(s) of the flows, please?

or check this solution:

https://powerusers.microsoft.com/t5/Building-Flows/Flow-to-Save-Email-Attachments-based-on-size/m-p/...

OlafBond_0-1643214040414.png

Here is my one step flow

Hi @OlafBond 

I set up a flow, you can refer to below screenshots.

Assume the file is pdf or docx and the size exceeds 50kb, the attachment will be saved.

vLilyWmsft_1-1643251708070.png

Add a judgment condition, if the file is pdf or docx and the size exceeds 50kb, the attachment will be saved.

You can modify it according to your actual needs

vLilyWmsft_10-1643254135457.png

Expression:

div(items('Apply_to_each')?['Size'],1024)

vLilyWmsft_11-1643254153088.png

vLilyWmsft_8-1643252868616.png

Save and test the flow.

When I receive an email like below.

vLilyWmsft_5-1643252374257.png

After flow runs, test7.8-1 will be created in my Google Drive.

vLilyWmsft_9-1643254020970.png

Hope the content above may help you.

Best Regards

If my answer helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you. It helped. Everything works great.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,783)