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 setup
Successful run info
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!
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:
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:
You have also posted this ...
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
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?
Hi @sestillings , in reply to message 4 from you.
Here is your file name:
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
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?
Thank you for the response! Here are screenshots of what is reported:
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:
I ask as I have just tested this and it works: for "test file"
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
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!
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional