cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brian13
Helper I
Helper I

'apply to each' only processing one file in OneDrive

Hello

I'm writing a flow to copy all files from a OneDrive folder to a Sharepoint Library and set the file's metadata.

The flow is initiated by a button (or manually) as I want it to process all the files not just new files.

It works fine but only for one of the four files in the OneDrive folder. I'm new to Flow and while I've searched and experimented I cannot get it to process the other files (they are all the same file but with slightly different names).

Here is the flow:

ApplyToEachProblem.JPG

 

does anyone have any suggestions? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @Brian13,

 

Do you want to copy all the files from a OneDrive folder to a SharePoint library?

Without using variables in the flow, please take the following configuration for a reference.

The flow is also triggered by Button, then List files in folder, under the Apply to each, add the actions Get file metadata and Get file content, by using these two actions, all the metadata of the files can be copied. Then use the action SharePoint Create file.

The flow just works fine and all the files can be saved from OneDrive to SharePoint library properly.

1.PNG2.PNG 

 

Best regards,

Mabel Mao

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

View solution in original post

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @Brian13,

 

Do you want to copy all the files from a OneDrive folder to a SharePoint library?

Without using variables in the flow, please take the following configuration for a reference.

The flow is also triggered by Button, then List files in folder, under the Apply to each, add the actions Get file metadata and Get file content, by using these two actions, all the metadata of the files can be copied. Then use the action SharePoint Create file.

The flow just works fine and all the files can be saved from OneDrive to SharePoint library properly.

1.PNG2.PNG 

 

Best regards,

Mabel Mao

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

View solution in original post

Thank you

I also found why i was only seeing one file being copied to the document library - I was not changing the name of the file for each of the files in the flow. I was expecting the document library to accept multiple files with the same name (as it does when you upload files 'manually') so what was happening is that I was writing over the top of each file with the same name.

All fixed, thank you.

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,212)