Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Appending Email Attachment file name with email details

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a flow running successfully that triggers when a new email arrives into a certain Outlook folder that has an attachment.  We have vendors that send files to this Inbox all throughout the day and I have Outlook rules running that drop them into this certain folder based on criteria either in the subject/body or the email address.

 

Once the trigger starts, it grabs the attachments, adds a date/time value into the filename, and then uploads it to our SFTP site.  The problem is the files are all randomly named and there's no good way to differentiate them once they are on the SFTP site.  I tried adding a Category to the Rule in Outlook that would categorize the email when it moves the file out of the Inbox, but I found that the Category is not an output on the Power Automate Email "When a new email arrives (V3)" trigger.

 

Long story short, I am trying to come up with a way to dynamically add a vendor name or some identifying factor to the filename of the attachment so we can easily determine within the file system who the file belongs to.  We can't use the sender address, as there could be many different senders that don't have the vendor name in the email address, etc....  I thought adding the Category was the simplest since I could apply that at the Outlook rule level.

 

The only way I could really think of otherwise is to have separate flows looking at every single sub-folder and then statically adding the vendor name as part of the filename changes.  This isn't really scalable solution as there could be 100s of these to manage and maintain.


Curious to see if anyone had any ideas or have run up against something similar to this in the past.  It's too bad the Outlook rule couldn't append the name of the Rule into the subject or something similar so each email got "tagged" with the respective value.

 

Thanks in advance for any help.

  • VictorIvanidze Profile Picture
    12,207 on at
    Re: Appending Email Attachment file name with email details

    Hi @cmsciggs.

    how's going on? 

  • VictorIvanidze Profile Picture
    12,207 on at
    Re: Appending Email Attachment file name with email details

    Hi @cmsciggs,

     

    it looks like you have to assign category after receiving a message.  Have a look at this: https://ivasoft.com/assigncatflow.shtml

    Instead of the "Invoke an HTTP request" action use the non-premium "Send an HTTP request" one.

  • Verified answer
    v-xiaochen-msft Profile Picture
    on at
    Re: Appending Email Attachment file name with email details

    Hi @cmsciggs ,

     

    Here is the method to get the mail category.

    vxiaochenmsft_0-1673937690894.png

    https://graph.microsoft.com/v1.0/me/messages/@{triggerOutputs()?['body/id']}

    vxiaochenmsft_1-1673937727152.png

    vxiaochenmsft_2-1673937762207.png

     

    Best Regards,

    Wearsky

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow