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

Moving document and folders within document library across any levels

Hi All,

 

I have a requirement to copy documents and folders/subfolders across any levels within a document library.

Have a JSON variable source and destination. Destination path usually doesn't exist, hence using Create New folder action to create that path first. 

 

Issue I am facing is documents/folders gets copied successfully to the destination, however nested folders/files come outside and gets copied in parent folder as well. Any idea where I m going wrong? Below is my flow screenshot.

 

Kumarrl2022_2-1669305928474.png

 

 

Kumarrl2022_1-1669305834207.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-chengfen-msft
Microsoft
Microsoft

Hi @Kumarrl2022 ,

Could you please tell me:
1. Which Action did the first Full path get from?
If it is obtained from [Get files (properties only)], the full path of the file should be obtained.

 

Do you want to move a certain folder to the newly created folder?
Here is a test for your reference:

Here are the folders and files that need to be moved:

vchengfenmsft_0-1669347528526.png

This is the parent folder of the target folder:

vchengfenmsft_1-1669347621471.png

Here is flow:

I assume you are using the path of [Get files (properties only)], it is recommended to use Folder path here.
The contents of the Folder path cannot be used to populate, we need to make some modifications.

slice(items('Apply_to_each_2')?['{Path}'],0,-1)

vchengfenmsft_2-1669347637203.png

vchengfenmsft_3-1669347646191.png

Here is result:

vchengfenmsft_4-1669347670919.png

Best Regards

Cheng Feng

 

 

 

View solution in original post

1 REPLY 1
v-chengfen-msft
Microsoft
Microsoft

Hi @Kumarrl2022 ,

Could you please tell me:
1. Which Action did the first Full path get from?
If it is obtained from [Get files (properties only)], the full path of the file should be obtained.

 

Do you want to move a certain folder to the newly created folder?
Here is a test for your reference:

Here are the folders and files that need to be moved:

vchengfenmsft_0-1669347528526.png

This is the parent folder of the target folder:

vchengfenmsft_1-1669347621471.png

Here is flow:

I assume you are using the path of [Get files (properties only)], it is recommended to use Folder path here.
The contents of the Folder path cannot be used to populate, we need to make some modifications.

slice(items('Apply_to_each_2')?['{Path}'],0,-1)

vchengfenmsft_2-1669347637203.png

vchengfenmsft_3-1669347646191.png

Here is result:

vchengfenmsft_4-1669347670919.png

Best Regards

Cheng Feng

 

 

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,406)