cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pedacokorilo
Helper III
Helper III

save attachments in dynamic subfloders

Hi i need in my corporation to save any attachments comes to my email. and there is a problem, i need to all attachments save in this dynamic automatic create folder: year/mail from/subject

 

I use this instruction https://powerusers.microsoft.com/t5/Building-Flows/Email-Attachments-saved-to-a-new-Folder-named-tod...

 

and make flow what i need to save an attachment in these subfloders. But if i answert to client to send me some more attachments and he answerd me and send it there is an failed status

chyba_odpoved.png

I think there is a problem with that Re in answer so flow cant make an subfolder.

 

Please if someone know a resolution i would be very glad.

 

Or also if you need more information there is no problem to place it here.

 

Thanks

 

 

9 REPLIES 9
ChristianAbata
Super User
Super User

hi @pedacokorilo  the problem is that your flow is trying to create another folder so as you see at the end you have.

filename.png/Hereagaingafolder 

This is happening becaouse the variable that you are using is different.

For example if you use the subject to create a folder, then when your flows run if the name of subject is the same the flow creates files inside but if is diferent the flow creates a new one.

 

Please to understant better could you add us an scrennshot?



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

thank you for answer, there is screenshot of my flow

 

chyba_odpoved_flow.png

 

and there is my concat:

concat('/test_prilohy/',utcNow('yyyy'),'/',triggerBody()?['From'],'/',triggerBody()?['subject'])

But i sad again there is only problem when someone answer to my mail and create a subjet with RE.

Hi @pedacokorilo,

 

You could create a condition to judge the subject of the Email whether it starts with "RE:". If it is, you could use the replace() function to remove it. Then create the new subfolder.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for answer, but how i make a condition (IF) When there is a :RE in subject? So if there is a :RE in subject flow create only folder with text sin subject wiuthou :RE? If you have some instruction about this it would be great. Thanks

One more thing if i chage in subject from Re: to only Re it is ok, so there is a problem that flow thing Re: is some function or something like that so there is an error

 

drive/items/getByPath('/test_prilohy/test_prilohy/2020/some.mail@gmail.com/Re')/ faktura plyn/daktela_navod.pdf//content není platný.

 

bracket is closed behind gmail.com/Re')

so i found there is only problem  with colon :

 

If i try to make a subject test : dvoutečky there is the same error

Výraz drive/items/getByPath('/test_prilohy/test_prilohy/2020/some.mail@gmail.com/test ')/ dvoutečky/daktela_navod.pdf//content není platný.

 

So is there aby solution for that to make a subfolder from any characters? or in onedrive or sharepoint i cant make folders with colon?

 

Thanks

There is a problem only with colon :

 

If i manually delete : from subject and leave just Re (som subject) all  works. But if i leave a colon there is an error

Výraz drive/items/getByPath('/test_prilohy/test_prilohy/2020/some.email@gmail.com/test ')/ dvoutečky/daktela_navod.pdf//content není platný.

 

If you can see there is a subject test dvoutečky and that colon make ')/

So there is a problem with colon in playn text?

Hi @pedacokorilo,

 

Sorry for late, the colon issue may be caused by the blank " ", since when you create a folder it isn't allowed start at a blank, you could have a try with this expression (please pay attention to the blank after the ":"):

replace(triggerBody()?['Subject'],'Re: ','')

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi this instructions works - thanks for that, but i discovered an another (very similar problem maybe i can said the same problem) if someone forward ana message there is Fwd: (for forwarding).

 

Can i edit your expression to repair both Re: and Fwd: 

 

Thanks a lot man

 

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,363)