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!
Hello Joef, can I get this screenshot in a more clearer mode please. Mine I'm creating the flow using Onedrive. Thank you
Hello Joef, can I get this screenshot in a more clearer mode please. Mine I'm creating the flow using Onedrive. Thank you
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.
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.
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.
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.
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.
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).
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?
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):
Let us know if something is unclear.
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473