Showing results for 
Search instead for 
Did you mean: 
Not applicable

Move File to Library Folder based on file metadata.

I am using Sharepoint to manage the photos my students submit for my school's yearbook. I've tried for two days, and can't the flow to work the way I want. Here is how I want the work to flow:


  1. Students add an image file to a Sharepoint Library called "Photo Submissions." Once they've uploaded the file, students update the file details to reflect what yearbook page they think the image belongs. I created a custom column for this library, and students must choose a value from a dropdown that includes the static page numbers (example: 40 Middle School Faculty).
  2. I created a flow that allows me to approve or reject the submitted file. NOTE: I would like the approval status and proposed yearbook page to show for each file.
  3. Once I approve or reject an image, I would like for the file to move from the initial Library (Photo Submissions), to a different Library called "Yearbook Photo Storage." In the Yearbook Photo Storage Library, I have one folder for each yearbook page. If the student selected "40 Middle School Faculty" as the proposed yearbook page, I would like the file to be moved to Yearbook Photo Storage/40 Middle School Faculty.

I appreciate any and all help and advice!


Super User
Super User


I didn't address the approval part of the Flow in my example - if you need an example for that, please let me know.  My example would be used is the document was approved - use this on the "yes" side of your condition if the approval outcome is "Approve".

My example shows you how to copy the file from the Photo Submissions library to the yearbook Poto Storage library in the appropriate folder.  In the Photo submissions library, I specify the page/folder in an option column.

If this needs additional explanation, please let me know.

One note - in my example, I used a variable.  Since this value won't be changing once set, I could have/should have used a compose action rather than a variable.  This is a best practice.





If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Not applicable

Thank you for your help. I'm trying.


When I tried to use the Initialize variable action, I got an error message: The operation 'Initialize variable' can only be used at top level.


I've looked at the compose action, but I'm not sure what I'm doing. I'll keep searching for information on the compose action.


I didn't realize that you were inside of a loop....

Initialize the variable at the top of your Flow - such as right after the trigger.  You don't need to set it to a value.

Where I have the initialize action, use a set variable action instead.

A compose action can only be set once - if the value can change then you need to use a variable. 

Alos, you won't be able to use a compose action iside of a loop.



If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.


Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,108)