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 / AI Builder - Scan each...
Power Automate
Unanswered

AI Builder - Scan each PDF document in specific order?

(0) ShareShare
ReportReport
Posted on by 12

I am very very new to Power Automate and the AI Builder and successfully created my first automation.

I have multiple documents in name order and a table in each document. Each document has the same column headers and various number of rows of data.

During tests, Power Automate recognises I put one document into a OneDrive folder and then auto-populates the extracted data and puts it an Excel document in the correct header columns. Perfect !

However, when I upload multiple documents the data extracted and put into the Excel document is not in order. It seems to mix the data from any document and puts it in any rows it likes.

Is there a setting to make Power Automate (or AI Builder if it is this) to scan one document first, populate the Excel with that document data, then go to the next document and repeat, so that all data is in order?

Categories:
I have the same question (0)
  • Verified answer
    CedrickB Profile Picture
    Moderator on at

    If you use the trigger "When a file is created", there is no guaranty that file will be processed in the order they have been created if you add several in a row.

    One option is to temporize the creation of each file.

    Another is to add the file creation date when inserting a row in Excel and then sorting the Excel table

    See Filter Query, Order By on Excel Rows - Power Platform Community (microsoft.com)

  • paspuggie48 Profile Picture
    12 on at

    Thank you for responding CedrickB and some interesting solutions. Albeit I'm at a basic level I'll have a look at those options.

    Many thanks again 🤞

  • Antrod Profile Picture
    Moderator on at

    Hi @paspuggie48 ,

     

    Another option you may want to try is the concurrency configuration of your flow. Please look at this thread for more information: Solved: Allow only 1 instance of a flow to run at the same... - Power Platform Community (microsoft.com)

     

    However if you upload multiple files at a time in a folder, it doesn't guarantee to take a specific order. In that case, you'll need to look at CedrickB's recommendations.

     

    Thanks.

  • paspuggie48 Profile Picture
    12 on at

    Thanks Antrod, unfortunately setting to concurrency of 1 only scanned one document. I'll try CedrickB's option and I think the temporize of creation comment was apt also.

     

    So, I thought of having a separate flow to move the files from the current folder (where I copy them from and then to the OneDrive folder) and having a time delay in between the time it takes to copy over each file. Theoretically speaking.

  • Barret Profile Picture
    652 Most Valuable Professional on at

    It's strange that a concurrency setting of 1 only caused the one document to scan. It should have queued up the other runs to run one after another (though not in any specific order as others have said). Just out of curiosity, since you didn't post your flow's design, does the flow recreate the Excel spreadsheet every time with the same name? It might be that it did actually process all the files, but overwrote each time. You might not have seen that before you set the concurrency to 1 as the multiple files were all running simultaneously. But you might have seen that not all the data was collected in the spreadsheet in that case.

  • paspuggie48 Profile Picture
    12 on at

    Thank you for your input Barrett.

     

    My apologies, I cannot share the exact data itself because it's sensitive data at work, however I did a comparison. I tested Doc1 by uploading it into my OneDrive folder and Power Automate & AI Builder scans the data row-by-row and the output was perfect, with each row of data in order. I deleted Doc1 and tested Doc2 and again it was perfect, all rows of data were in order.

     

    I deleted all docs in that folder and re-tested by uploading both Doc1 and Doc2 at the same time (and they are named differently). What I noticed thereafter is the rows of data were mixed (which I reported before).

     

    So in essence it scans Row 1 of Doc1 and then scans Row 1 of Doc2 and populates the Excel table with both of those 2 rows of data. Then it scans Row 2 of Doc1 and then scans Row 2 of Doc2 and uploads both those 2 rows to Excel and repeats until it gets to the end of the page.

     

    Maybe its because I'm 'Adding a row into a table' ??

     

    paspuggie48_0-1637590192388.png

     

    I suppose therefore the question is, how do I have it scan every row until end of page, then upload to Excel then go to the next document and repeat?

     

  • Barret Profile Picture
    652 Most Valuable Professional on at

    Yes, if you drop both files at the same time, the flow will trigger multiple times and run simultaneously if the Concurrency config setting is not set to 1. So, dropping two files at the same time, will trigger two flows, one for each file, which will both write to the same destination Excel file at the same time. I would say it's probably luck more than anything that it appeared to alternate back and forth between the source files for each row.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard