cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Nenad
Regular Visitor

OneDrive move file to folder named by part of that file's name

On create file in specific folder in OneDrive that file should be moved to another folder which name is part of file's name.
Example:
Create file root/documents/nmn-something.pdf
Move file to folder root/nmn
4 REPLIES 4
Nenad
Regular Visitor

Re: OneDrive move file to folder named by part of that file's name

I tried solution from this question https://powerusers.microsoft.com/t5/Building-Flows/When-create-file-and-approved-move-file-todirecto...

 

but i got error

"status": 400

"message": "

One or more invalid characters are present in the path (/LiveFolders/[\"YmFsa2FuLWhlai5wZGY=\"]/nmn-something.pdf)."
 
 
Community Support
Community Support

Re: OneDrive move file to folder named by part of that file's name

Hi @Nenad,

 

Could you provide a screenshot of your Flow configuration?

It seems that you have made an error while designing the folder name.

Could you provide details about it?

I am testing on my side and using Move or rename a file to move the file.

The point to note is that when configuring File Path, the path must be followed by the Display name of the file, because the path to the file is required instead of the path to the folder.

Use an expression to get a filename that does not contain extension, as a folder name.

Image reference:

61.PNG

Flow works well, as below:

62.PNG

Please take a try or provide your flow configuration and we would found the cause of the issue.

 

Best Regards,

Barry

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

Re: OneDrive move file to folder named by part of that file's name

Thanks @v-bacao-msft

I tried your flow but I got error something like Split expected string but got Null. It seems like triggerBody()?['Name'] does not return filename
Community Support
Community Support

Re: OneDrive move file to folder named by part of that file's name

Hi @Nenad,

 

What is your current progress? Is the configuration of your Flow the same as mine?

Or you could provide the configuration of your Flow.

I did a test on my side, triggerBody()?['Name'] is actually the output of Dynamic content - List of file Name.

12.png

The output is the name of the file:

13.PNG

Please try again.

 

Best Regards,

Barry

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

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,622)