web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Reply to Email Automat...
Power Automate
Unanswered

Reply to Email Automatically based on matching Email Subject

(0) ShareShare
ReportReport
Posted on by 43
I have a flow that downloads a quotation file (in pdf) from a company, creates a folder based on the file name (i.e quotation no.) and saves the email subject and attachment on a Sharepoint list. 
 
I then signed the pdf quotation manually and upload to a folder. When this signed quotation is created in the folder (that matches the quotation no.), it triggers a flow to get the attachment (download pdf), upload the signed quotation file to the sharepoint list and update the "quotation signed date" column. 
Below is what my sharepoint list looks like
 
 
What I want to do now is to reply to the sender (based on the EmailSubject) that the quotation has signed and attach the signed quotation pdf file, but I am struggling to do this. Would anyone be able to help?
 
Below is what my flow looks like.
I generate an array so that if the file name contains a name that matches the quotation number, it will update the "quotation signed date" column based on the date & time the file was uploaded to the folder. 
 
 
Everything worked well (i.e. updated the sharepoint list, added the file to sharepoint list, updated the signed quotation date column on sharepoint)

However,  When I ran the flow, an error occured in the last step of apply to each 4 and I don't understand why. I want the flow to reply to the email (that matches the Email Subject recorded on the sharepoint list) and attach the signed file. Greatly appreciated if anyone can help with this. 
Categories:
  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at
    Can you expand that Reply to email (v3) and show the specific error message?
     
    It might be related to the encoding of your pdf attachment. Can you share the inputs as well? Specifically the contentbytes property.
  • ChristianAbata Profile Picture
    8,953 Most Valuable Professional on at
    Coul you please send an screenshots about the error in the last item?
  • Kehong Profile Picture
    43 on at
    The error that I get is here...
     
     
    For the output
  • Mark Nanneman Profile Picture
    993 Moderator on at
    A. 
    Are you sure that you're correctly referencing a "Get file Content" action for your Attachments on your Reply to Email action?  Do you have any action that's retrieving file content for the attachment you want to send on the email reply?

    Can you show the code view of your "Reply to Email" action?

    B.
    Also, I notice that your "Apply to each 4" loop has three items, are you sure you want to be replying to three emails? 

    The whole design of your flow seems a bit messy.  For instance in your first "Apply to each" loop it looks like it's taking the output from a Filter action,  but it doesn't appear that it's doing anything with those filtered items and it's just doing stuff with unfiltered sharepoint item arrays in nested apply to each loops.  I'd take a look at that.



    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!
    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  | 
  • Kehong Profile Picture
    43 on at
    Yes it is a bit messy and I truly not sure how to get it to work. 
    Are you able to show me an example of how the flow can be better designed? I am not quite familiar with the apply to each function. 
     
     
  • Mark Nanneman Profile Picture
    993 Moderator on at
    Well, to start with can you show the "code view" of you filter?  Or copy/paste the code?



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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard