Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Copy file also copy the folder and bring up error message

(0) ShareShare
ReportReport
Posted on by

Hi Community, 

 

may I don´t see it and it is very simple - but please help me to solve these issue. I try to simple move files after extraction to another folder but the action still try to copy the folder it self as well. So the folw copy the file within folder correctly but also throw an error in every run - Source or Destination likely invalid. Check that the file exists and has an SPListItem ID.

 

I guess it depends to the identifyer I use here  - but not sure what I have to enter to excl. folder to copy. 

 

Thx 

Scherodan_0-1672389923932.png

 

Scherodan_1-1672390112124.png

 

 

 

  • Scherodan Profile Picture
    on at
    Re: Copy file also copy the folder and bring up error message

    @grantjenkins  - you got it! Thx a lot!😁

  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Copy file also copy the folder and bring up error message

    EDIT - Please ignore the below. I did a translate from German to English and can see you're using Extract folder.

     

    It looks like you're using Get files to get the initial files, then Move file within the Apply to each to move each of the files returned. Or is this not the case? If it is, then you can still add the Filter Query to Get files so that Move file only runs for files (not folders). Or is this not the case?

     

    Within your Apply to each you can have a condition to check each item returned and check the IsFolder property. If IsFolder is true, then don't move it.

     

    Example below:

     

    grantjenkins_0-1672394304940.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • Scherodan Profile Picture
    on at
    Re: Copy file also copy the folder and bring up error message

    Hi @grantjenkins  - thx for your hint. I don´t use Get files (sry all in German) - I use Move files - but maybe i add a get files in between the extraction of the folde and the movement - so I could use your filter note.

     

    I´ll give it a try.

     

  • grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Copy file also copy the folder and bring up error message

    It looks like you're using Get files (not sure due to the language) which brings back both files and folders. If you just want it to retrieve files you can put the following within the Filter Query of Get files.

     

    //Only return files - not folders
    
    FSObjType eq 0

     

    grantjenkins_0-1672390746123.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 >