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 / Get name of doc or pdf...
Power Automate
Answered

Get name of doc or pdf in onedrive folder to rename a combined pdf

(0) ShareShare
ReportReport
Posted on by 6

I'm a new using PA with Plumsail (thank you to the most patient tech support people, ever) to combine pdfs.

The flow combines 2 pdf files into one but with a static name.

I would like to name that by refering or copying as a string to the file name of a pdf in a completely different folder; this pdf is created and recreated several times during the day.

When I add the step "Create File" after "Merge PDF" in the File Name field I can get the Folder Name but not the File Name of the file it contains.

checkspa_0-1717450162489.png

I want to replace Test02.pdf

 

Categories:
I have the same question (0)
  • WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at

    You haven't said much about where the file is which you want to use the name from. Is it always the only file in a specific folder? Always the most recently modified file in a specific folder? Is the folder name/path static or dynamic? How would you identify the correct file if you were browsing the folder structure for it? The answer depends on a lot on information you have not provided.

    However, once you figure out how to identify the file you can do a List files in folder action then use filter array to filter for the correct file then get its name with first(body('Filter_array'))?['{FilenameWithExtension}'] assuming it's in SharePoint.

  • checkspa Profile Picture
    6 on at

    Always the most recently modified file in a specific folder?

    Yes

    Is the folder name/path static or dynamic?

    Static

     

  • Verified answer
    WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at

    In that case, do the List files in a folder action then you can find the newest modified file like this:
    1. List files in a folder - pick the folder you want:

    WillPage_0-1717540721080.png

    2. Add a Compose and enter the expression

    sort(outputs('List_files_in_folder')?['body/value'],'LastModified')

    WillPage_1-1717540754731.png

    3. Now another compose with

    last(outputs('Compose'))?['Name']

    WillPage_2-1717540783435.png

     

    I create a new file in that folder then run the test:

    WillPage_3-1717540936111.png

     

  • checkspa Profile Picture
    6 on at

    Thank you but I'm stuck on how to get the output from the 2nd Compose as an input in "Create File" File Name field?

    checkspa_0-1717600359405.png

    And any suggestions for learning PA? I only started last week out of neccessity but I think this could be really useful

  • WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at

    You should see the Compose in the Dynamic content tab of that popup that's on the right of your screen shot.

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