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.
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.
Hi @cmsciggs ,
Here is the method to get the mail category.
https://graph.microsoft.com/v1.0/me/messages/@{triggerOutputs()?['body/id']}
Best Regards,
Wearsky
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional