Notifications
Announcements
Hi,
I need help setting up a Power Automate flow with the following requirements:
Trigger: When a new email arrives with attachments (specifically PDFs).
Save Attachments: Automatically save the PDF attachments to a specific OneDrive folder.
AI Processing: Use the PDFs as input for a ChatGPT prompt (or an OpenAI action if available).
Response Handling: Capture ChatGPT's output and send it as an email response to the original sender or a specified recipient.
I would appreciate guidance or an example flow that could help me accomplish this. Let me know if any connectors, licenses, or APIs are required beyond standard Power Automate and OneDrive.
Thank you!
Go to Power Automate.
New Automated Cloud Flow.
Trigger:
When a new email arrives (V3)
Configure:
Choose the mailbox.
Optionally set filters (e.g., From, Subject Contains).
Add Action:
Get Attachment (Outlook)
This requires:
Message Id = Message Id from the trigger.
Message Id
Attachment Id = Attachment Id (from a loop).
Attachment Id
Tip: Use an Apply to Each over Attachments.
Attachments
Inside the loop:
Condition:
Attachment Name ends with .pdf
Attachment Name
.pdf
Example:
endsWith(items('Apply_to_each_Attachment')?['Name'], '.pdf')
If Yes: proceed If No: skip
Action:
Create File (OneDrive)
Folder Path = Your target folder.
File Name = Attachment Name.
File Content = ContentBytes from Get Attachment
ContentBytes
This creates a physical file in OneDrive.
How to do this?
Option A: AI Builder Read (No Code)
Use AI Builder: Extract text from PDF
If you have the license, it works out of the box.
If you have Azure OpenAI or OpenAI connector, add:
Create Completion
Model: gpt-3.5-turbo or gpt-4
gpt-3.5-turbo
gpt-4
Prompt: e.g.,
lease analyze this document and summarize the key points: [Your extracted text here
Capture the AI response.
Send an email (V2)
To: From (original sender) or any recipient.
From
Subject: e.g.,
Summary of your attachment: [Original Subject]
Body:
ere is the AI-generated summary of your PDF: [AI Response Text]
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 501 Super User 2025 Season 2
Tomac 323 Moderator
abm abm 237 Most Valuable Professional