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

getting filename and build a folder with part of it

I like to get the filename from a file, dropped in a sharepoint folder and create a folder, named with part of the filename and putting the file afterwards in the generated folder. I have problems getting the filename. My workflow looks like this:

 

workflow.png

Happy for any help, thx in advance!

 

lottiwurm

1 ACCEPTED SOLUTION

Accepted Solutions

@lottiwurm 

Your screen shot indicates that you are using "when a file is created in a folder" which is not the same as "when a file is created.  They are not the same trigger.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

6 REPLIES 6
Super User III
Super User III

@lottiwurm 

I suggest using the When a file is created trigger instead and then selecting a specific folder followed by a Get File content action and a create file action. Then, you can reference either the Name or Filename with extension in Dynamic properties.

Alternatively you could simply use a When a file is created trigger followed by a copy file action.

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Helper I
Helper I

Hi Scott

 

I do use the "when a file is created" trigger, if I am right? But I am not able to find a way to "extract" a part of the file name for further actions. 

 

lottiwurm

Can you give an example of the filename you're trying to work with and which parts you are trying to extract? With a combination of split(), first(), last(), and substring() it should be possible to extract the portion you need.

Helper I
Helper I

shure

 

Bestellung EB50277 2020-12-09 13-57-14.pdf

 

I like to create a folder named with the bold part of the file name(s). Or just the part with the number would be ok too.

My nr. 1 problem is to get the file name... from the file, dropped in the sharepoint folder, because, the output under compose "x-ms-file-name-encoded"  is a string, not a file name.

@lottiwurm 

Your screen shot indicates that you are using "when a file is created in a folder" which is not the same as "when a file is created.  They are not the same trigger.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Helper I
Helper I

Sorry, one more question: For sharepoint, I just can find "when a file is created (properties only). The "when a file is created" trigger is only availlable for OneDrive. Does it matter or not?

 

Sorry, I am a beginner... 😞

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (76,413)