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 / Delete SharePoi...
Power Automate
Unanswered

Copy / Delete SharePoint files - delete flow not working

(0) ShareShare
ReportReport
Posted on by 26

Hello! I'm facing an issue with a flow I built. I'm essentially trying to "move" files that automatically post to the "Email Messages" folder in SPO (via Teams) to different folders in that same SPO site based on the file name (email subject line).

 

As far as I can tell, to accomplish this you must set up a Flow that first copies the file to the desired destination folder and then delete the original file from the original location.

 

I've set up this Flow and the copy portion works great but I can't get the original file to delete from the orioginal location. Flow also is telling me this flow ran successfully but I can confirm the delete portion is not working.

 

Flow setupFlow setupSuccessful run infoSuccessful run info

Categories:
I have the same question (0)
  • Brad_Groux Profile Picture
    4,556 on at

    Your issue may be from the File identifier option in the Delete file action. This should likely be the Id paremeter, and you probably also need a Get file properties step after the Copy file step.

    Also, I'd recommend putting in a nested condition after the file copy, and use that condition to verify that the file has been copied via a logical expression. You want to verify the copy was successful, before deleting the file. 

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. THANKS!

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @sestillings , thank you for your post.

    From what I can see , your condition is returning false. 

     

    Can you please expand the results from "When a file is created or modified (properties only)", post similar to what I have below:

    Capture-480.png

     

    I ask as I have just tested this and it works: for "test file"

    Capture-481.png

    I would like to make sure your file name will match the condition, i.e , does it contain "project alpha" or not.

     

    If you have found my post helpful, please mark thumbs up.

    Any other questions, just ask.

    Thanks, Alan

  • sestillings Profile Picture
    26 on at

    Thank you for the response! Here are screenshots of what is reported:

    Screen_Shot_1_of_3.pngScreen Shot 2 of 3.pngScreen_Shot_3_of_3.png

     

  • sestillings Profile Picture
    26 on at

    Thanks for your response! You make an excellent point, re: confirming the file does in fact copy before deleting. I'm a bit stuck on what "value" I should use to verify this? Do you have any pointers in terms of types of values that would get me to where I want to go here?

     

    Screen_Shot_2019-04-23_at_2_30_07_PM.png

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @sestillings , in reply to message 4 from you.

    Here is your file name:Capture-482.png

    As explained before, your condition is looking for "project alpha". 

    "IDEXX Midyear Report 2018_1507075478" does not contain "project alpha" so it returns false.

     

    Regards the rest of your Flow, your copy, your delete etc. Please search on through the forums (if you don't mind) as there are several replies/solutions out there for this very thing already and I am confident once you get a match on your condition, you will be able to get the logic on this.

     

    If stuck, after we see a matching condition it will be easier for us to advise ... This template though is were I started when moving files and delting files in OneDrive so maybe it can provide some insight in advance.

     

    If you have found my posts helpful, please mark thumbs up.

     

    Any other questions, just ask.

     

    Thanks, Alan

  • sestillings Profile Picture
    26 on at

    Hi Alan - Right, however the reason this file was identified is because it's an attachment of the original email (which does contain the "project alpha" phrase.) The core issue is that the file that did successfully copy with the "project alpha" phrase did not end up deleting. Any thoughts?

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @sestillings , I am not sure we are talking bout the same thing (although we may be). Let me further explain ...

     

    Here is your image:

    Capture-483.png

     

    This condition is looking for the "When a file is created (properties only)" Name paramater ... is that correct?

    If so, your file, and there is only one that has been processed by the condition is called:Capture-482.png

    You have also posted this ...Capture-484.png

     

    The yes branch hasn't run as the condition has returned false.

    There is no mention of a file containing "*project alpha*" .

     

    You say "however the reason this file was identified is because it's an attachment of the original email (which does contain the "project alpha" phrase.)

     

    I can see no file containing the phrase "project alpha" in the images you have provided and the Flow is triggered on one file only, the one called "IDEXX Midyear Report 2018_1507075478". Are you maybe saying the email has the phrase, in it's body or title perhaps?

     

    maybe I am, missing something here ...

    i.e, this Flow will not get as far "Get file properties" or "Delete file" with the condition returning true?

     

    You say "The core issue is that the file that did successfully copy with the "project alpha" phrase did not end up deleting. Any thoughts?" ... Have you maybe posted screen shots of a Flow run for a diferent file name? if so, maybe post the run that shows the successful copy & the delete with error to avoid the confusion. Post it's error and we can better advise.

     

    Lastly, In your first image showing the delete ... you are using "Identifier" ... Is that from the Trigger "When a file is created (properties only)", or the Action, "Copy file" as it may just be this that is the issue but I can't tell from your images which you are using so if you can advise on that it may help us get closer to a resolution.

     

    If you have found my post helpful, please mark thumbs up.

    Any other questions, just ask.

    Thanks, Alan

  • sestillings Profile Picture
    26 on at

    Thanks for the follow up, Alan. I'm attaching new screenshots from an unsuccesful Flow so you can see an example of an item that contains that key phrase. While this shows the entire Flow failed, the file did successfully copy to the desired folder. It did not, however, delete from the original folder. I appreciate you taking some time to help me out!

    Screen_Shot_2019-04-24_at_7_46_36_AM.pngScreen_Shot_2019-04-24_at_7_46_46_AM.pngScreen_Shot_2019-04-24_at_7_46_57_AM.png

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