Share via

Rename and save PDF attachments from Outlook

PA - Nadia Coetzee 0 Reputation points
2026-03-16T11:53:13.68+00:00

We want to extract PDF attachments from Outlook and save them on Sharepoint. We want AI builder to get information inside the PDF document to rename the attachment, before saving. How do i build someting like that

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Steven-N 22,485 Reputation points Microsoft External Staff Moderator
    2026-03-16T13:35:37.19+00:00

    Hi PA - Nadia Coetzee

    Based on the scenario described, the requirement is to automatically extract PDF attachments from Outlook emails, read specific information inside those PDF documents (such as invoice number, customer name, or date), and use that extracted data to rename the files before saving them into a SharePoint document library.

    As far as I know, this cannot be achieved with standard Power Automate actions alone, because Power Automate does not natively understand or parse the content inside PDF files. An AI-based document processing capability is required to read and interpret the document content before renaming and storing the files.

    That said, the recommended and supported approach is to use Power Automate together with AI Builder’s document processing model:

    1. Create or use an AI Builder Document Processing model (either a prebuilt model such as Invoice Processing, or a custom document processing model if the PDF layout is specific).
    2. Train and publish the AI Builder model to extract the required fields from the PDF (for example: invoice number, customer name, document date).
    3. Build an automated Power Automate cloud flow that:
      • Triggers when a new email arrives in Outlook (personal or shared mailbox).
      • Filters and retrieves only PDF attachments.
      • Sends each PDF file to the AI Builder Process documents action.
      • Uses the extracted field values returned by AI Builder to dynamically construct a new file name.
      • Creates the renamed file in the target SharePoint document library.
    4. Optionally add conditions to handle missing or low-confidence extraction results (for example, applying a fallback file name or routing the file for manual review).

    You can watch here as a tutorial: https://www.youtube.com/watch?v=Co5oar7d4Qc

    Note: This information is provided as a convenience to you. These sites are not controlled by Microsoft, and Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please ensure that you fully understand the risks before using any suggestions from the above link.

    Link documents:

    Hope my answer will help you, for any further concern, kindly let me know in the comment section.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


  2. Q&A Assist
    2026-03-16T11:53:33.7366667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Build this in three logical parts: extract attachments from Outlook, analyze/rename with AI Builder, then save to SharePoint.

    1. Extract PDF attachments from Outlook to SharePoint
    • Use a Power Platform solution that processes incoming emails and saves attachments to SharePoint.
    • Configure a Power Automate flow that:
      1. Triggers on new email (for example, Outlook connector “When a new email arrives”).
      2. Filters to messages that contain PDF attachments.
      3. For each attachment, creates a file in a SharePoint document library (temporary name, for example original attachment name or message ID + index).
    • This matches the pattern described where a Power Platform solution extracts attachments from incoming emails and saves them to SharePoint before further processing.
    1. Use AI Builder / document processing to read information from the PDF
    • In SharePoint, use Microsoft 365 document processing (Syntex) with a prebuilt model to extract information from PDFs.
    • For simple, structured PDFs (forms, invoices, receipts, contracts, bank statements), use the simple document processing model:
      • It extracts key-value pairs, selection marks, named entities, and barcodes.
      • It supports .pdf and image file types in more than 100 languages.
    • Steps:
      1. Create a simple document processing model following “Create a prebuilt model”.
      2. Upload a sample of the PDF type to analyze and configure extractors for the fields that will drive the file name (for example, “VendorName”, “InvoiceNumber”, “Date”).
      3. Apply the model to the SharePoint document library where the email attachments are stored.
      4. When a new PDF is saved by the flow, the model runs and writes extracted values into SharePoint columns.
    1. Rename the file using extracted metadata
    • After the model has populated the metadata columns, use another Power Automate flow (or a later step in the same flow, with a delay/polling pattern) to rename the file:
      1. Trigger: “When a file is created or modified” in the SharePoint library where PDFs are stored.
      2. Condition: run only when the extracted metadata columns are populated (for example, VendorName is not empty).
      3. Compose a new file name from the extracted fields, for example:
        • concat(VendorName, '_', InvoiceNumber, '_', formatDateTime(Date,'yyyyMMdd'), '.pdf').
      4. Use SharePoint “Move file” or “Update file properties” (depending on library and configuration) to set the new file name. This effectively renames the file while keeping it in the same library or moving it to a final library/folder.
    1. Optional: Merge or split PDFs before/after processing
    • If multiple PDFs from one email need to be combined or split before or after AI processing, use the built-in PDF actions in SharePoint/OneDrive:
      • Merge: open a PDF in SharePoint/OneDrive, select More options (…) → Merge, choose additional PDFs, and save as a new combined PDF in the library.
      • Extract: open a PDF, select More options (…) → Extract, choose pages to extract, and save them as new PDFs.
    • These actions can be integrated into the overall process if the business scenario requires combining or splitting documents before metadata extraction and renaming.

    End-to-end architecture summary

    • Outlook → Power Automate: trigger on new email, save PDF attachments to a SharePoint “Incoming” library.
    • SharePoint + document processing model: automatically extract key fields from each PDF into columns.
    • Power Automate: watch the library for new/updated files with extracted metadata, then rename/move the file based on those fields into a final library/folder.

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.