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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating a flow to del...
Power Automate
Unanswered

Creating a flow to delete a previously created file, upon creating a new file.

(0) ShareShare
ReportReport
Posted on by 196

Hi All.....I have a bit of a difficult flow to understand so I'm going to try to explain it the best I can.  

 

I have a power app that is connected to a SP List, as well as a SP Library.  The Power App in question uses the list to both edit, and save, various "facility" records through a gallery.  I have created a flow that populates a word template (no premium connectors used) based off of the record information within the gallery, which then saves the new word document into the SP Library.  Each time the flow is triggered, a new document is generated with a different name.  For example, lets say I selected a record called "Catoosa" within my power apps gallery.  Once selected, I can then click a button called "Generate" to populate the word document and save it within my SP Library as mentioned.  Each time I select generate, and new file is created and saved in the SP Library with the name "Catoosa", along with the date and time that it was generated.  If I selected a different record, such as "Amarillo", it generates based off of the record information and saves it the same as above with the date and time associated with generating it.  

 

Here is my question.  Is there an additional flow I can add to "delete" the PREVIOUSLY saved word document for which I am generating the record from? For example, lets say on monday, I generate a word document from the "Catoosa" record, which saves the file in the SP Library with the name "CatoosaEAP_08142023_24624.docx".......then on Tuesday, I go edit the Catoosa record, and generate a new word document which is saved in the same SP Library with a NEW file name "CatoosaEAP_08152023_013046.docx.....is it possible for the flow to then delete the previously saved record named "CatoosaEAP_08142023_24624.docx"?

 

Thank you in advance!  

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @DerrickH ,

    Is there metadata linked to your document?
    For example, you might have a text column with your created document labeled as "Catoosa."
    This would function as a document identifier.
    Consequently, you could execute a Get Files operation utilizing an oData filter, where the Column eq 'Catoosa.'
    Subsequently, in the following step, you could delete the document that has an ID matching the one obtained from the previous action, before creating a new document.

     

     

     

  • DerrickH Profile Picture
    196 on at

    @SudeepGhatakNZ The SP list that populates the power app gallery has a column labeled "Facility Location Name".  It is this column that I'm using in an expression in the "Create File" connection within Automate to name the new word file.  I have a screen shot of my flow attached for a preview.  Forgive me though, I'm not familiar enough with automate to understand all of the steps you mentioned.

    Screenshot 2023-08-15 075714.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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard