cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nmyk
Frequent Visitor

rename multiple PDF files by using data from within the pdf files

I split a large PDF file into 350 PDF files.

 

I would like to Auto-Rename the split pdf files using data from within those files to generate the new name. (e.g the business name found in the split file).

 

I was able to create AI builder to a model to find the business name.

However, i'm not sure how to create a flow to rename the pdf files.

 

Thanks for your help in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
JoeF-MSFT
Power Apps
Power Apps

Hi @nmyk - great use case!

 

The following example can help you achieve this. Here is what it does:

  1. Get all the files in a folder in SharePoint
  2. Call the AI Builder Form Processing model for each file
  3. Create a new file in another SharePoint folder. The file name is one of the fields extracted by the form processing model along the '.pdf' file extension. 

 

 

2022-01-27_0-23-58.png

 

I hope this helps! Let us know if we can help provide more clarifications. 

View solution in original post

10 REPLIES 10
JoeF-MSFT
Power Apps
Power Apps

Hi @nmyk - great use case!

 

The following example can help you achieve this. Here is what it does:

  1. Get all the files in a folder in SharePoint
  2. Call the AI Builder Form Processing model for each file
  3. Create a new file in another SharePoint folder. The file name is one of the fields extracted by the form processing model along the '.pdf' file extension. 

 

 

2022-01-27_0-23-58.png

 

I hope this helps! Let us know if we can help provide more clarifications. 

nmyk
Frequent Visitor

Thanks @JoeF-MSFT .

I used one drive instead and i successfully auto-renamed my files.

 

I am also running a send flow that send out emails. I have been testing the flow. 

I made sure the file name is the exact match from the folder. 

It works but sometime fails .... not sure why

 

JoeF-MSFT
Power Apps
Power Apps

Hi @nmyk , congrats for building the automation flow with OneDrive!

 

Would it be possible to share a screenshot of the error you are seeing? 

nmyk
Frequent Visitor

Hi @JoeF-MSFT - Thank you for your response.

 

It seems that the List Files in Folder automation is limited to 20 items only.

My folder currently has 127 items (that has been automatically renamed by AI builder).

Do you know if there is a way to circumvent this limitation?

nmyk_0-1643315430286.png

 

JoeF-MSFT
Power Apps
Power Apps

Hi @nmyk , yes there is a way to increase the number of files. You need to:

 

1. Click on the three dots on the upper right of the List files in folder action

JoeFMSFT_2-1643320235886.png

 

 

2. Enable Pagination and set the limit above 127. To 150 for example.

 

JoeFMSFT_1-1643320145063.png

 

Happy document processing. 🙂

nmyk
Frequent Visitor

Thanks @JoeF-MSFT .

 

The pagination seems to work but is still causing some issues.

The flow has been running for  35 minutes and only 8/127 items succeeded. 

 

And because of my "if no" condition, I received over 8,000 email notifications. I even received 100+ of the "if no" emails for the 8 items that succeeded. 

 

Is the pagination setting up some sort of endless loop? 

I had to manually cancel the 100+ running flow to stop the "if no" emails.

 

 

 

JoeF-MSFT
Power Apps
Power Apps

Hi @nmyk,

 

Ah yes, getting 8,000 emails is no fun 😟

 

What is the trigger of your flow? Could you share a screenshot of your flow?

 

Thanks! 

nmyk
Frequent Visitor

@JoeF-MSFT 

 

nmyk_0-1643387037815.png

 

JoeF-MSFT
Power Apps
Power Apps

Thanks @nmyk ! 

 

What is the purpose of the automation flow you are building? How many rows did you select in Excel? For every row you select, the automation will get triggered and list all the files present on the OneDrive folder you have chosen. 

nmyk
Frequent Visitor

Hi @JoeF-MSFT 

 

The purpose of this flow is to: Email 120 customers an invoice.

 

  1. I created an excel sheet to list : Business name, Emails addresses, File name and month.
  2. I used AI builder to rename each invoice using data from within the invoice (eg business name)
  3. I want to generate a summary of all emails sent (just as a record/ double check).

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,525)