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 / Renaming PDF Files bas...
Power Automate
Answered

Renaming PDF Files based on Content

(0) ShareShare
ReportReport
Posted on by 10

Successfully built an AI tool called "Read from Q" that renames a file based on content.  

 

Is there a way to delete or rename the original PDF file?  I added a Delete action at the end, but it keeps deleting the file I created. 

 

hockeywood_0-1694358352175.png

 

Categories:
  • Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at

    Hello,

     

    Just to clarify since I do not see the delete.

    • [File Content] is the full path to the original file?
    • And once everything is done, you are trying to delete [File Content], and you are saying it deletes the new file Testing/Done

    ??

     

    Can you put the delete action back in exactly how it is when its causing you this issue please and show it again. I would also, when you do that, have you checked the inputs / outputs of the delete to validate the URI its using in the delete?

    Cheers
    --------------------------------------------------------------------------------
    If I had answered your question, please mark your post as Solved
    If you like my post please give it a thumbs up
    Thanks
    Michael Gernaey MCT | MCSE | Expert | Ex-Microsoft
    https://gernaeysoftware.com

  • hockeywood Profile Picture
    10 on at

    Thanks Mike,

     

    Thanks Mike.  The original file name is never the same name so I can't hard code the filename, and I don't know how to dynamically refer back to the original file in the Delete.  It is clear to me that my Delete action is referring to the file name used in the previous step and this is a roadblock for me.   The inputs and outputs are not in the templates i used to build this, so i have some learning to do on that topic.

     

    hockeywood_0-1694359610535.png

     

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at

    Hi,

     

    Wait sorry let me start over. One second, I somehow misread your flow. I will send you a solution

     

    Cheers
    --------------------------------------------------------------------------------
    If I had answered your question, please mark your post as Solved
    If you like my post please give it a thumbs up
    Thanks
    Michael Gernaey MCT | MCSE | Expert | Ex-Microsoft
    https://gernaeysoftware.com

     

  • Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at

    Hi,

     

    What is the list files for?

     

    Ignore what I said before, pretend this my first response.

     

    If you are using List files and then doing an Apply to Each on those files, I would expect all the other steps to be IN the Apply to each, where you would read the content from the file that is in that iteration of the loop, Extract, Create file, and then delete.

     

    But it seems you are passing in the actual file content and ignoring your loop, is that really the intent?

  • hockeywood Profile Picture
    10 on at

    I think the intent was lost in the way I had it structured.  Shifting to the following, which seems more streamlined and accomplishes the task of using PDF content to rename the file (I have to rename a few hundred of these files). 

     

    It seems like adding a Delete action to the end of this would be relatively easy, but please advise if I may be overlooking something.  Thanks 

     

    hockeywood_0-1694361166946.png

     

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at

    Hi,

     

    Yes if that is your intent is to use a Trigger, then yes, you can get the file path/uri etc from the Trigger and delete at the end. No issues.

     

    I would suggest you wrap it in an error handler though incase something happens and you delete the original file without actually having any outputs.

     

    Also, suggestion, maybe archive the original file for a bit and then delete it after 30 days or something versus immediately deleting so in case there is an issue you can manually re-run it. Just a thought.

     

  • hockeywood Profile Picture
    10 on at

    Very much appreciated - thanks Mike!  

     

    Cheers

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard