Forum Discussion

jrwarwick's avatar
jrwarwick
Brass Contributor
Dec 15, 2023

Iterating over a list of files and applying similar actions to each, particularly extraction

In my company tenant, we have Microsoft Copilot for Microsoft 365 (E5) mostly deployed. I have had success in extracting from individual PDF file form-letters with the copilot.microsoft.com interface. Something like this:

The abbreviations ABC,DEF,NA respectively stand for "All Business Codes","Define Extras Form","Not/Applicable".
Please take note that the "filing type" is a special classification that can only be "All Business Codes","Define Extras Form",or"Not/Applicable". Usually, it is found immediately after the phrase "Declaration of filing of". Please remember this when you extract information from PDF files.
In a single table row, please list the "Declaration of filing of" date, doc name, applicant name, form number, filing type, header date at the document top, and code number

And I use the attach feature to specifiy a specific, single PDF file in OneDrive, and this works well and I get the result I expect.

 

However, I would like to have the copilot perform that same exact activity across a list of files, but it seems to get confused if I attempt to attach multiple files, I even get "I’m sorry, but I am an AI language model and do not have the capability to read or extract information from PDF files" which is kind of true, I guess, but the act of attaching the files explicitly to the prompt should have redirected it to the index, just like in the single attachment case, I would think.

 

I have tried a  couple of times to slightly modify the prompt to "For each of the attached files, read the file and generate a table row listing the..." or "...In a single table row, please list the [columns part] ... But please combine all those rows into one table." etc.

 

But maybe my whole approach is wrong. I am sure multiple attachments are good for context focus for a series of questions, or perhaps for combining together some general freeform texts, but I specifically want to iterate over a list of files, or folder full or something, and have repetitive actions taken at each iteration. How can I do that?

 

  • Currently, there is a restriction to a single file only. jrwarwick . Please submit feedback in the product. 

  • jrwarwick's avatar
    jrwarwick
    Brass Contributor
    For the record, I pasted my above posting text into copilot.microsoft.com and below is the reply, but as I've already learned, and as AI purveyors stamp into every single response: "AI-generated content may be incorrect", so I'm not taking the statement that it "is designed to work with a single file attachment at a time" at face value. I'd like to see documentation or hear from a knowledgeable human on the matter.

    ```I’m sorry to hear that you’re having trouble using Microsoft Copilot for Microsoft 365 (E5) to extract information from multiple PDF files. Currently, Microsoft Copilot is designed to work with a single file attachment at a time. It is not capable of iterating over multiple files or a folder of files and performing repetitive actions on each file.

    However, there are other ways to achieve your goal of extracting information from multiple PDF files. One option is to use a script or a tool that can automate the process of iterating over the files and extracting the desired information. You can use tools like Power Automate or write a script in a language like Python to automate the process. These tools can help you to extract the information from each file and combine the results into a single table.

    I hope this information helps you to find a solution that works for you. If you have any further questions or need additional assistance, please don’t hesitate to ask.```
    • Yana Terukhova's avatar
      Yana Terukhova
      Icon for Microsoft rankMicrosoft

      Currently, there is a restriction to a single file only. jrwarwick . Please submit feedback in the product. 

Resources