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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (4,440)