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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,051)