cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sarahpoulin
Helper I
Helper I

Delete only docx file after copied to Sharepoint

I have created a Word template where after I fill in fields in PowerApp, it uses Power Automate to generate a .docx and then convert to the pdf and those are created in Onedrive. Then it copies both of them to a Sharepoint shared folder. But it copies both the .pdf and the .docx. I want one of two things:

 

1) Either delete the .docx file before the .pdf is copied to the shared folder in Sharepoint,

or

2) Delete the .docx file after it and the .pdf are copied to the shared folder in Sharepoint.

 

I have two separate flows. One for the Word template, and the other to copy files between OneDrive for Business and SharePoint (which is triggered when a new file appears in a specific OneDrive folder).

6 REPLIES 6
chsanche
Community Support
Community Support

Hi @sarahpoulin 

 

If the Flow is moving both files, you should have an action in that is moving not only the .pdf but also the .docx file. You will need to remove this action from your Flow. Also, if you want to delete a file, if the file was created within the same Flow, the delete action won't work.

 

Best Regards,

--

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions help users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

If this post helps you give a :thumbs_up: and if it solved your issue consider Accept it as the solution

What's happening is the .docx file is being created in the Onedrive folde, then converted to pdf in that same folder:

deletedocx1.png

 

But when new files are created in that same folder, another flow copies those new creations to Sharepoint shared folder (I don't know how to do pdf conversion with Sharepoint, nor how to share a Onedrive folder; don't think either is possible).

deletedocx2.png

 

You said, "you should have an action in that is moving not only the .pdf but also the .docx file. You will need to remove this action from your Flow." I don't see how I can remove this action. Is there something I can put in the advanced options for "When a file is created"?

Hi @sarahpoulin 

 

On the second Flow, you can input a condition that checks on the File name and if the file contains ".docx" then you can delete the file, if it is not a ".docx" then you create the file on SharePoint which is a ".pdf".

 

Best Regards,

--

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions help users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

If this post helps you give a :thumbs_up: and if it solved your issue consider Accept it as the solution

What is the condition that I need to input? Do I type in an expression? What is the expression?

Did you ever get a resolution to this? I'm trying to do the same thing.

Nope. No resolution. I had to give up for now.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,813)