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

Copying all the folder from one drive business to personal one drive

I am trying to copy all my existing folder from onedrive business to personal onedrive. But my flow stop at apply to each. 

Please help!

ggwp_i12354_0-1636801417305.png

ggwp_i12354_1-1636801428776.png

replace(item()?['Path'], last(split(item()?['Path'], '/')), '')
 
The error code
ggwp_i12354_2-1636801470758.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-LilyW-msft
Community Support
Community Support

Hi @ggwp_i12354 

The "List file in folder" action included in the OneDrive connector can only retrieve files under the specified folder and do not include files under subfolders.

If you want to get the files under the subfolder in OneDrive. Please consider submit an idea in the Microsoft Flow idea forum:

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas

 

If you want to create a file in OnDrive at the same time when a file is created in OneDrive for business, you can use the trigger When a file is created.

I set up a flow, you can refer to the screenshots below to see if it helps.

vLilyWmsft_0-1637208907545.png

vLilyWmsft_1-1637208943219.png

Expression:

last(split(outputs('Get_file_metadata')?['body/Path'],'root:'))

vLilyWmsft_2-1637208961544.png

Expression:

first(split(outputs('Compose'),outputs('Get_file_metadata')?['body/Name']))

vLilyWmsft_3-1637208998017.png

Save and test the flow.

When a file is created in OneDrive for business folder,the file will be created in OneDrive.(No need to create a folder manually in OneDrive, if the folder does not exist, flow will automatically create it )

vLilyWmsft_4-1637209174328.png

vLilyWmsft_5-1637209191842.png

Hope the content above may help you.

Best Regards

If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-LilyW-msft
Community Support
Community Support

Hi @ggwp_i12354 

The "List file in folder" action included in the OneDrive connector can only retrieve files under the specified folder and do not include files under subfolders.

If you want to get the files under the subfolder in OneDrive. Please consider submit an idea in the Microsoft Flow idea forum:

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas

 

If you want to create a file in OnDrive at the same time when a file is created in OneDrive for business, you can use the trigger When a file is created.

I set up a flow, you can refer to the screenshots below to see if it helps.

vLilyWmsft_0-1637208907545.png

vLilyWmsft_1-1637208943219.png

Expression:

last(split(outputs('Get_file_metadata')?['body/Path'],'root:'))

vLilyWmsft_2-1637208961544.png

Expression:

first(split(outputs('Compose'),outputs('Get_file_metadata')?['body/Name']))

vLilyWmsft_3-1637208998017.png

Save and test the flow.

When a file is created in OneDrive for business folder,the file will be created in OneDrive.(No need to create a folder manually in OneDrive, if the folder does not exist, flow will automatically create it )

vLilyWmsft_4-1637209174328.png

vLilyWmsft_5-1637209191842.png

Hope the content above may help you.

Best Regards

If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (3,021)