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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copy file also copy th...
Power Automate
Unanswered

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

 

 

 

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    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.

  • Scherodan Profile Picture
    on at

    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.

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    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

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard