SOLVED

Naming of attachments in Flow

Copper Contributor

I have the following question: I have created a flow to save attachments from a certain mail address to sharepoint. Now I want to name the files with flow when I save them in sharepoint.

The name of the file should be the subject of the mail, but only part of it (the mails are always named the same since they are autogenerated from a system). The subject of the mails is like this:

text text 11849850 - text

Now I want the file that is saved on sharepoint only to have the number that is in the subject line as the name. I think this should be possible with functions but I can't get it to work.

Can anybody help me with this?

Thank you!

 

2 Replies
best response confirmed by christina_hoeglinger (Copper Contributor)
Solution

Hi @christina_hoeglinger,

 

You can use an "Initialize Variable" action to strip out the unnecessary text and then use that variable to set the file name.

 

Here is the code for the variable (based on your example): 

last(split(first(split(variables('varEmailSubject'), ' - ')), ' '))
"varEmailSubject" stores your example email subject line of "text text 11849850 - text". You will have to change it to the correct "Dynamic Content" within Flow.
 
Here is how it looks in Flow and the output:
Capture1.PNGCapture.PNG
 
I hope this helps.
 
Norm

Thank you so much! Worked like a charm :)@Norman Young 

1 best response

Accepted Solutions
best response confirmed by christina_hoeglinger (Copper Contributor)
Solution

Hi @christina_hoeglinger,

 

You can use an "Initialize Variable" action to strip out the unnecessary text and then use that variable to set the file name.

 

Here is the code for the variable (based on your example): 

last(split(first(split(variables('varEmailSubject'), ' - ')), ' '))
"varEmailSubject" stores your example email subject line of "text text 11849850 - text". You will have to change it to the correct "Dynamic Content" within Flow.
 
Here is how it looks in Flow and the output:
Capture1.PNGCapture.PNG
 
I hope this helps.
 
Norm

View solution in original post