cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

When create file and approved, move file todirectory with part same name

 

Hello! 

 

I have a directory where files are being created. I would like to create a flow that will move files created in this folder to a sub-folder based on the file name.

 

The files being created is named "NAME-BI-Jan-2018" and I would like them to be moved to a folder called "NAME".

 

I created the flow, but for 200 customers, I have to create 200 conditions, one for each client.

I would like to make sure that the system reads me the name of the client that is initial to the file and automatically moves it into the client's respective folder.

 

I did some tests without success ...

Functions try:

substring(triggerBody()?['{FilenameWithExtension}'],0,indexOf(triggerBody()?['{FilenameWithExtension}'],'-'))

and

substring(triggerBody()?['x-ms-file-name-encoded'],0,indexOf(triggerBody()?['x-ms-file-name-encoded'],'-'))
 

 

Ideas?

 

Thanks Eros

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: When create file and approved, move file todirectory with part same name

HI @ITmanager,

 

I would suggest you use Create file action instead of Copy file.

 

When using action Create file, we could specify the folder path with dynamic content. Your file name should have the same format, so when the files have the same NAME, then the files would be created in the existing folder. If the file has a different name, flow would create a new folder then save the file into the newly created folder.

 

Please take the following screenshot for a reference:

1.PNG

 

 

 

Best regards,

Mabel Mao

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

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: When create file and approved, move file todirectory with part same name

HI @ITmanager,

 

I would suggest you use Create file action instead of Copy file.

 

When using action Create file, we could specify the folder path with dynamic content. Your file name should have the same format, so when the files have the same NAME, then the files would be created in the existing folder. If the file has a different name, flow would create a new folder then save the file into the newly created folder.

 

Please take the following screenshot for a reference:

1.PNG

 

 

 

Best regards,

Mabel Mao

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

View solution in original post

Highlighted
New Member

Re: When create file and approved, move file todirectory with part same name

it works perfectly 😄

 

Thanks a lot

 

Eros

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (4,256)