SOLVED
Home

Naming of attachments in Flow

%3CLINGO-SUB%20id%3D%22lingo-sub-874218%22%20slang%3D%22en-US%22%3ENaming%20of%20attachments%20in%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-874218%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20the%20following%20question%3A%20I%20have%20created%20a%20flow%20to%20save%20attachments%20from%20a%20certain%20mail%20address%20to%20sharepoint.%20Now%20I%20want%20to%20name%20the%20files%20with%20flow%20when%20I%20save%20them%20in%20sharepoint.%3C%2FP%3E%3CP%3EThe%20name%20of%20the%20file%20should%20be%20the%20subject%20of%20the%20mail%2C%20but%20only%20part%20of%20it%20(the%20mails%20are%20always%20named%20the%20same%20since%20they%20are%20autogenerated%20from%20a%20system).%20The%20subject%20of%20the%20mails%20is%20like%20this%3A%3C%2FP%3E%3CP%3Etext%20text%2011849850%20-%20text%3C%2FP%3E%3CP%3ENow%20I%20want%20the%20file%20that%20is%20saved%20on%20sharepoint%20only%20to%20have%20the%20number%20that%20is%20in%20the%20subject%20line%20as%20the%20name.%20I%20think%20this%20should%20be%20possible%20with%20functions%20but%20I%20can't%20get%20it%20to%20work.%3C%2FP%3E%3CP%3ECan%20anybody%20help%20me%20with%20this%3F%3C%2FP%3E%3CP%3EThank%20you!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-874218%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-874379%22%20slang%3D%22en-US%22%3ERe%3A%20Naming%20of%20attachments%20in%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-874379%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F407056%22%20target%3D%22_blank%22%3E%40christina_hoeglinger%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20an%20%22Initialize%20Variable%22%20action%20to%20strip%20out%20the%20unnecessary%20text%20and%20then%20use%20that%20variable%20to%20set%20the%20file%20name.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20code%20for%20the%20variable%20(based%20on%20your%20example)%3A%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CPRE%3E%3CSPAN%3Elast(split(first(split(variables(%3C%2FSPAN%3E%3CSPAN%3E'varEmailSubject'%3C%2FSPAN%3E%3CSPAN%3E)%2C%20%3C%2FSPAN%3E%3CSPAN%3E'%20-%20'%3C%2FSPAN%3E%3CSPAN%3E))%2C%20%3C%2FSPAN%3E%3CSPAN%3E'%20'%3C%2FSPAN%3E%3CSPAN%3E))%3C%2FSPAN%3E%3C%2FPRE%3E%3CDIV%3E%3CSPAN%3E%22varEmailSubject%22%20stores%20your%20example%20email%20subject%20line%20of%20%22text%20text%2011849850%20-%20text%22.%20You%20will%20have%20to%20change%20it%20to%20the%20correct%20%22Dynamic%20Content%22%20within%20Flow.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EHere%20is%20how%20it%20looks%20in%20Flow%20and%20the%20output%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20628px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F133464i155305C923EF502C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Capture1.PNG%22%20title%3D%22Capture1.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20630px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F133463i5E5FA54C1B3C29B8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Capture.PNG%22%20title%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EI%20hope%20this%20helps.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ENorm%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877034%22%20slang%3D%22en-US%22%3ERe%3A%20Naming%20of%20attachments%20in%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877034%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20so%20much!%20Worked%20like%20a%20charm%20%3A)%3C%2Fimg%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F111382%22%20target%3D%22_blank%22%3E%40Norman%20Young%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
christina_hoeglinger
Occasional 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
Highlighted
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
Highlighted

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

Related Conversations
Office 365 Outlook accounts for Partners
opendesign in Microsoft 365 on
2 Replies
Flow approvals
chrisjones2020 in Office 365 on
0 Replies
Form -> Flow -> Manager ->Response
Anatoly123 in Microsoft Forms on
1 Replies
Teams adaptive card scaling is off on IOS
FinnHat in Teams Developer on
2 Replies