web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help with attachment s...
Power Automate
Unanswered

Help with attachment saving to file system with Conditional check and character stripping

(0) ShareShare
ReportReport
Posted on by 2

Hi all,

I want to automate saving all pdf's that are send to a specific email address to a folder on our local file system.

The problem is that some pdf's contain special characters ("/") that need to be stripped before saving the file. Also, I only want pdf's, not images (from a signature), to be saved and not the pdf's that contain certain words. 

I found some how-to's on how to do this, but now my other functions aren't working anymore.

 

This is the flow I have right now:

rbuyckx_0-1606822484679.png

rbuyckx_1-1606822517456.png

createArray('@','ß','²','³','µ','´','°','^','=','(',')','&','$','§''~','#','%','*',':','<','>','?','/','|',' ')
 
msedge_1sxIq4XkBV.png
("§" symbol is used internally to indicate that the email needs a manual check)
 
msedge_15n22EzhjF.png
replace(variables('Sanitize'), item(), '')
 
msedge_6ruoM2bT8f.png
The flow works except for the last part; it does create the pdf with the correct name, but the file size changes and when the flow is finished, the pdf is corrupted. I think what's going on is the flow is saving each attachment it finds in the email and saving it to one file. If I look at the Teams messages Flow sends me, there are 6 messages, and in the email, there are also 6 attachments: one good pdf - the one I need, one pdf that needs to be filtered and 4 images that are in the email signature. If I send an email that does not contain any other pdf files or images in the signature, all works fine.
 
This is my first flow and I think it can be a huge timesaver for our business if I get the hang of it, any help is appreciated. 
Categories:
I have the same question (0)
  • Verified answer
    JohnAageAnderse Profile Picture
    1,986 on at
    Re: Help with attachment saving to file system with Conditional check and character stripping

    Hello @rbuyckx 

    Did you find a solution to your issue or is it still relevant?

    The last screenshot contains an Apply to each loop, which should not be there, as the 2nd screenshot already has the Apply to each loop that you need. So all the steps inside the last loop should go into the Yes branch in your condition (3rd screenshot).

    But tell us how far you got, so we may better be able to help you

    Kind regards, John

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard