Skip to main content
Community site session details

Community site session details

Session Id : jz/ISCdaqD3GHNbsJJFrWf
Power Apps - AI Builder
Answered

Using AI Builder to extract data from PDFs

Like (0) ShareShare
ReportReport
Posted on 29 Sep 2021 14:39:55 by 12

Hello!

 

I'm very new to Power Automate and Power Apps. I've built this flow in AI Builder to essentially extract 3 key pieces of data from multiple 6 page PDFs (there are 4000+ PDFs, and the layout on all of them is exactly the same) and then populate this information into a Google Sheet. (I use an =IMPORTRANGE to pull this information into another master spreadsheet).

 

The flow runs correctly, but then at a random point, it errors out, and comes up with the second attached error. I can't seem to find a solution anywhere for this and would really love some help understanding this and how to fix this. 

 

Am I just overloading it with too many PDF's to extract information from, or is there is a limitation somewhere in my flow?

 

 

Thanks in advance!

Categories:
  • Mike254 Profile Picture
    5 on 07 Mar 2024 at 13:16:44
    Re: Using AI Builder to extract data from PDFs

    Hello Joef, can I get this screenshot in a more clearer mode please. Mine I'm creating the flow using Onedrive. Thank you

  • Mike254 Profile Picture
    5 on 07 Mar 2024 at 13:16:41
    Re: Using AI Builder to extract data from PDFs

    Hello Joef, can I get this screenshot in a more clearer mode please. Mine I'm creating the flow using Onedrive. Thank you

  • Verified answer
    JoeF-MSFT Profile Picture
    on 05 Oct 2021 at 22:24:52
    Re: Using AI Builder to extract data from PDFs

    Thanks @Pritzstik for the info!

     

    I believe what is happening is that the Apply to each block is outside the Do until block. Apply to each needs to be inside Do until.

     

    JoeFMSFT_0-1633472577505.png

     

  • Pritzstik Profile Picture
    12 on 05 Oct 2021 at 09:31:43
    Re: Using AI Builder to extract data from PDFs

    I changed the count but it's still completing successfully after just 100 files. Rest of the flow is attached. For context, this value was set at 60.I changed the count but it's still completing successfully after just 100 files. Rest of the flow is attached. For context, this value was set at 60.Screenshot 2021-10-05 at 10.26.12.pngScreenshot 2021-10-05 at 10.26.24.pngScreenshot 2021-10-05 at 10.26.30.png

  • JoeF-MSFT Profile Picture
    on 04 Oct 2021 at 21:10:18
    Re: Using AI Builder to extract data from PDFs

    Hello again - one additional change is needed that I just realized.

    On the Do until action, you will need to increase the Count option to a number equal or greater to the number of files you plan to process.

    JoeFMSFT_0-1633381724839.png

     

  • JoeF-MSFT Profile Picture
    on 04 Oct 2021 at 21:03:47
    Re: Using AI Builder to extract data from PDFs

    Hi @Pritzstik - ask as many questions as needed. 🙂

     

    The flow should run until it processes all 4,000 files. Can you check that the conditions are correctly set? Feel free to share a screenshot of your flow.

    2021-09-30_23-30-35 (2).png

  • Pritzstik Profile Picture
    12 on 04 Oct 2021 at 15:19:19
    Re: Using AI Builder to extract data from PDFs

    Okay I got this to work. I was selecting the wrong Id tag. 

     

    Final question? Do I have to run this flow every 100 files? The flow stopped (successfully) after the next 200 files. That's somewhat manual if I have 4000 files, I'd have to run the flow 40+ times.

  • JoeF-MSFT Profile Picture
    on 02 Oct 2021 at 15:53:25
    Re: Using AI Builder to extract data from PDFs

    Hi - thanks for the update!

     

    Correct, on the Delete file action, make sure select the Id returned by the List files in folder (folder A) and not the Id returned by Create file action (folder B). 

     

    JoeFMSFT_0-1633189929342.png

     

  • Pritzstik Profile Picture
    12 on 02 Oct 2021 at 10:56:12
    Re: Using AI Builder to extract data from PDFs

    I modified the flow, but I think there's an issue with this. It seems to be working, but only for the first 100 files, so in effect, it's just going through the first 100 files multiple times, creating duplicate lines on the Google Sheet. The flow indicates it's copying the file into Folder B and then deleting it from Folder B. Should the flow not be deleting it from Folder A once it's copied over to Folder B?

  • JoeF-MSFT Profile Picture
    on 30 Sep 2021 at 21:41:27
    Re: Using AI Builder to extract data from PDFs

    Great to hear that you got the flow to successfully run!

     

    Unfortunately the List files in folder in Google Drive only returns a maximum of 100 files. But there is a workaround we can do that might work for you. 🙂 The process is to:

     

    1. We iterate 100 files from folder A.

    2. For every file we process we copy it to another folder B, and delete the file from the original folder A.

    3. We repeat this process for 100 more files of folder A until there are no more files left once all have been processed and moved to folder B.

    4. The flow stops running once there are no more files in folder A.

    This is how you can build the flow to achieve it (you can click on the screenshot to see it bigger):

     

    2021-09-30_23-30-35.png

     

     

    Let us know if something is unclear.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete