Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Create Folder and Move File into Folder based on Metadata

(0) ShareShare
ReportReport
Posted on by 8

Dear Community,

 

i intend to move a file from the root directory of a document library into a folder wicht previously has to be created. The file comes from a ERP System and will be saved to the root directory. There in a Metadata column a number ist saved aswell. The first 10 characters of this numer are to be the folder name.

Therefore i created a calculated column which extracts the first 10 characters of the numer.

LarsAt_0-1656315878307.png

Now i intend to create the folder based on the columns content and to move the file into the newly created folder. I searched a lot and tried to build a new flow, but somehow i am stuck. I would appreciate if someone of the community could give me a hint where my fault is located. Many thanks for your time and help in advance. I appreciate it a lot. Following my flow screenshots:

LarsAt_1-1656316295128.pngLarsAt_2-1656316549706.png

LarsAt_0-1656316879043.png

LarsAt_0-1656317076210.png

 

 

  • LarsAt Profile Picture
    8 on at
    Re: Create Folder and Move File into Folder based on Metadata
    {
     "status": 400,
     "message": "Fehler beim Überprüfen des Vorhandenseins des Quellobjekts unter \"https://XXXXXXXXXXXXX.sharepoint.com/teams/MS-TEAMS.AT/273\" aufgrund des Fehlers \"The system cannot find the file specified. (Exception from HRESULT: 0x80070002)\".\r\nclientRequestId: XXXXXXXXXXXX\r\nserviceRequestId: XXXXXXXXXXXXXX"
    }
  • Unknown geen idee Profile Picture
    1,755 on at
    Re: Create Folder and Move File into Folder based on Metadata

    Dear Lars,

    Last try, before I have to step into another meeting.

    Are you sure you are showing the Output error message? Not the input message?

    Koen5_0-1656325278983.png

    If you are showing the output error message ... then I cannot help you further, this is beyond me.

     

    Happy flowing,

    Koen

  • LarsAt Profile Picture
    8 on at
    Re: Create Folder and Move File into Folder based on Metadata

    Dear Koen - 

     

    i adjusted to 5 minutes - without any positive result:

    {
     "host": {
     "connectionReferenceName": "shared_sharepointonline",
     "operationId": "MoveFileAsync"
     },
     "parameters": {
     "dataset": "https://xxxxxxxxxxxx.sharepoint.com/teams/MS-TEAMS.AT",
     "parameters/sourceFileId": 273,
     "parameters/destinationDataset": "https://xxxxxxxxxxxx.sharepoint.com/teams/MS-TEAMS.AT",
     "parameters/destinationFolderPath": "/Freigegebene Dokumente/01AN024665/",
     "parameters/nameConflictBehavior": 1
     }
    }

     

  • Unknown geen idee Profile Picture
    1,755 on at
    Re: Create Folder and Move File into Folder based on Metadata

    Dear Lars,

    I advised to wait a longer time ... 1min is sometimes not enough, please do not try to go for speed at this point. Just put 5min delay in and try it. Also, your screenshots, while revealing, do not allow to read the full text of your error message, please download the full text of the error and paste (while masking sensitive data).

     

    Happy flowing,

    Koen

  • Unknown geen idee Profile Picture
    1,755 on at
    Re: Create Folder and Move File into Folder based on Metadata

    Dear Lars,

    Thank you, it would be helpful if you were to include entire text of the error by downloading the output of the action.

    In general I see a 400 and 404 error which in (my limited) experience indicates an accessing issue, likely because the file is locked. 

    If you are sure that the actual file/folder is being created, I would first try the flow again, but put in a delay of around 3-4min before you try to use any newly created file/folder. This is to ensure that you flow actually works and no other issues exist.

    Once that is working fine, you can build in a 'Do Until' loop to automatically let the flow wait a certain time when a 40* error is thrown. You can find an example below and I am sure you can find a nice one somewhere on the forums.

     

    Koen5_1-1656320831693.png

     

     

    If this has helped you, please indicate in thread as 'Solution'.

    Happy flowing,

    Koen

     

     

     

     

     

     

     

  • LarsAt Profile Picture
    8 on at
    Re: Create Folder and Move File into Folder based on Metadata

    Dear Koen,

     

    i added a schedule event to wait one minute and tried to test the flow again.

     

    Even though the folder already exists it hadn't been identified as existing by the flow.,..

     

    and the file couldn't be moved with the following error message:

     

    LarsAt_0-1656320833574.png

     

  • LarsAt Profile Picture
    8 on at
    Re: Create Folder and Move File into Folder based on Metadata

    Dear Koen,

     

    many thanks for your fast reply.  As you can see i currently modified my flow - because i used the when a file is created or modified (properties ony) trigger.... so i can not extract the file content.... Here are my errors:

    LarsAt_3-1656318942567.png

     

    LarsAt_4-1656319027119.png

     

     

    LarsAt_2-1656318849471.png

     

    LarsAt_1-1656318782485.png

     

  • Unknown geen idee Profile Picture
    1,755 on at
    Re: Create Folder and Move File into Folder based on Metadata

    Dear Lars,

    I assume that you will get some kind of 'Status 400' error? It would help if you show what kind of error/failure you get.

     

    Reason for me assuming that you get some kind of 'Status 400' error is because you create a new folder and immediately try to put a file in there. In my experience this usually will require some built in delay or a 'Do Until' loop to check if the folder is not locked.

     

    Kind regards,

    Koen

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1