web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Based off a date in a ...
Power Automate
Answered

Based off a date in a sharepoint list, move created item into folder

(0) ShareShare
ReportReport
Posted on by 93

Hello, 


I have an app that uploads a photo to a document library. This document library is essentially a landing page for the data. I have 12 other documents libraries labeled like the following. 

-------------------

October 2020

November 2020

December 2020 

January 2021

------------------

I need to build a flow that is triggered from the document being created in Sharepoint and then checks the date that a user inputs and sends it to its perspective folder based off of the month. For example if a user submits a record with a selected date of 9/19/20 that the file is moved to the September folder.

 

Does anyone have any ideas on how to get this done?

Categories:
I have the same question (0)
  • Verified answer
    sudharsan1985 Profile Picture
    1,325 on at

    Hi @Maxwell123 

    • You have to create an Automated Flow using the trigger When a file is created or modified (properties only)
    • Fill in the properties like Site AddressLibrary Name.
    • Add the action named Condition. You should add 2 conditions with And operator.
      • Check whether the file is checked out or not
      • Check whether it is a file and not a folder.

    sudharsan1985_0-1601538793493.png

    • In the Yes branch of the condition, add the action Compose and define the following expression replacing the internal name of the date field. My date field name is UploadDate, you had to change it to yours.
    formatDateTime(triggerOutputs()?['body/UploadDate'], 'MMMM yyyy')
    •  Add the action Move file and fill in the following properties
      • Current Site Address - Source library site collection
      • File To Move - Choose the Identifier from the triggerOutput property.
      • Destination Site Address - If it is a same document library, choose the same site address or different based on your req.
      • Destination Folder - /<Dest document library name>/<Compose action output>
      • If another file is already there - Choose any of the option based on your req.

    sudharsan1985_1-1601539160841.png

    Try the above steps and let me know if you have any clarifications.

    Happy Flowing...

     

     

  • Maxwell123 Profile Picture
    93 on at

    Hello!

     

    Thank you so much for your detailed response! I have built a similar flow and have been testing with this all morning. I am very stumped right now. 

     

    I have attached a couple of photos pertaining to my issues but I will go into detail on them below:

     

    The condition reads: 

     

    ActionFailed. An action failed. No dependent actions succeeded.
     
    The Compose action works and I have tried changing my manual date that it reads in powerapps and both times I can tell it is directed to the right library! I tried todays date and it is trying to send to my "October 2020" library and I tried november 1st and it tried to send to "November 2020"
     
    On the Move File the error I get is "BadRequest"
     
    I can tell that it is trying to move the right file but on the outputs part of the error report this is the attached string.
      "message""Missing or mismatched field definition on the destination list for source field '_x0076_zd7' type 'Text'. Source site template id 'GroupWebTemplateID', target site template id 'GroupWebTemplateID'. Total blocked root objects in this operation is [1].\r\nclientRequestId: a4615558-a877-459f-99fc-5643eabd77f5\r\nserviceRequestId: a4615558-a877-459f-99fc-5643eabd77f5"
     
     
    Could this be that my date coming into Sharepoint from powerapps and the Sharepoint list column "PurchaseDate" is formatted for text? 
     
    Please Let me know if you need anymore information on this and I sincerely thank you for your help and insight!
     
    Maxwell  
     
     Screen Shot 2020-10-01 at 11.40.03 AM.pngScreen Shot 2020-10-01 at 11.39.47 AM.png
     
  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @Maxwell123 

    Are you trying to move the files in the same library inside a folder or a different from the source library? Also, can you confirm the custom fields if any are the same in their name and datatype on both the libraries?

     

  • Maxwell123 Profile Picture
    93 on at

    Hello, 

     

    I am trying to move a from one document library to another. To go over my process A user takes a picture of a credit card receipt and sends it off to a Sharepoint document library called "Credit Card Receipt Data" This essentially is a landing page for the data and from here I need to flow to check the "PurchaseDate" as sometimes these receipts will be uploaded in the month after they were bought. Based on the purchase date I need the flow to move the file to the correct document library like "October 2020" or November "2020"

     

    Again I appreciate your help so much!! 

     

    Thanks

  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @Maxwell123 

    If you are moving to a different library, can you please confirm the fields are the same in name as well as in field type? Just try the flow with the new test libraries created without any fields, normal default document libraries. If your flow is successful in moving the file then the problem is with the fields. Try it out and let me know if you have any issues.

     

  • Maxwell123 Profile Picture
    93 on at

    Hello!

     

    I was 100% certain all the fields were exactley the same in both libraries however there was 30+ columns! My workaround was just to do a copy and delete instead of a move! Thank you so much for your insight and the time you took to help me out!

  • vrajpatel Profile Picture
    2 on at

    How to do this if I only want to move files that are older than 7 days?

  • IndianRich Profile Picture
    2 on at

    I don't want to move documents or files. I want to move list items into a folder. Used to be able to drag and drop into folder when you made a mistake.  Now you can't do it. How do I do it in Power Automate based on a column setting with folder names?  That seems like it would be a simple task.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard