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 / Delete only docx file ...
Power Automate
Unanswered

Delete only docx file after copied to Sharepoint

(0) ShareShare
ReportReport
Posted on by 47

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).

Categories:
I have the same question (0)
  • Christopher S Profile Picture
    on at

    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!

  • sarahpoulin Profile Picture
    47 on at

    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"?

  • Christopher S Profile Picture
    on at

    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!

  • sarahpoulin Profile Picture
    47 on at

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

  • ITGuyinMD Profile Picture
    37 on at

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

  • sarahpoulin Profile Picture
    47 on at

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

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard