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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Saving PDF attachments...
Power Automate
Unanswered

Saving PDF attachments with customise name to SharePoint

(0) ShareShare
ReportReport
Posted on by

Hi 

 

How do I save a pdf attachment with generic name and save it as "attachment name_yy-mm-dd.pdf" ?

 

memento_1-1714611745370.png

 

memento_0-1714611711249.png

currently the file name only shows "attachment name.pdf"

 

This is a problem as i will receive the email daily with the same attachment name but the contents vary each day. 

So if the name remains the same then the current day attachment will overwrite the previous day.

 

I tried checking out this Renaming a File in SharePoint Online using Flow - Power Platform Community (microsoft.com)

but doesn't work.

memento_2-1714613219369.png

NOTE: I did not delete the file as I would like to see the 2 files first (ie. "attachment name.pdf" and "attachment name_yy-mm-dd.pdf") before adding the deletion action.

 

Anyone can provide a step-by-step guide?  Thanks!

 

 

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Re: Saving PDF attachments with customise name to SharePoint

    In the file name property specify an expression like this

    concat(first(split('Your Word file name goes here'),'.'),utcnow('yy-MM-dd'),'.pdf')
  • memento Profile Picture
    on at
    Re: Saving PDF attachments with customise name to SharePoint

    But the expression is invalid:

     

    memento_0-1714629317250.png

     

  • memento Profile Picture
    on at
    Re: Saving PDF attachments with customise name to SharePoint

    @v-zhos-msft  can help ? This is similar to Renaming a File in SharePoint Online using Flow - Power Platform Community (microsoft.com), i tweaked accordingly (see my initial post) but doesn't work.

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Re: Saving PDF attachments with customise name to SharePoint

    Here is the modified expression

    concat(first(split(outputs('Get_file_properties')?['body/{FilenameWithExtension}'],'.')),utcnow('yy-MM-dd'),'.pdf')
  • memento Profile Picture
    on at
    Re: Saving PDF attachments with customise name to SharePoint

    Hi @SudeepGhatakNZ 

    the expression has no error when saving, but when run the following error occured:

     

    Error
    Action 'Get_file_metadata' failed
     
    Error Details
    Route did not match
    clientRequestId: 5c62c39f-50e5-464b-89ed-aa73a76dddb1
    serviceRequestId: 5c62c39f-50e5-464b-89ed-aa73a76dddb1
     
     
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Re: Saving PDF attachments with customise name to SharePoint

    You might not have set the Get file metadata action properly. Screenshot?

  • memento Profile Picture
    on at
    Re: Saving PDF attachments with customise name to SharePoint

    Hi @SudeepGhatakNZ 

     

    Please see screen shot:

    memento_0-1715125291974.png

     

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Re: Saving PDF attachments with customise name to SharePoint

    @memento File identifier accepts the File ID field. What value does items('apply_to_each') return in your case?

     

  • memento Profile Picture
    on at
    Re: Saving PDF attachments with customise name to SharePoint

    @SudeepGhatakNZ 

    Which id should i choose? 

    memento_0-1715126109726.png

     

  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Re: Saving PDF attachments with customise name to SharePoint

    @memento I think you are overcomplicating your flow. Try the attached flow and see if it fits your use case.

     

     

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard