This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Hi guys,
I am receiving some data form a third party every month as an attachement in a email.
I usually download every file save it and then use it inside a alteryx workflow.
I was wondering if there could be a way to reveice those mails directly as an input in alteryx so i don't need to first download and save the attachement.
Also i know this is a Alteryx forum, but if it is not possible to solve this problem through alteryx would you know what i could use to solve this problem?
Thank you guys in advance?
Hi @max_hfr, I have been able to do something similar but I wrote a Microsoft Powershell script that I could execute within a command line tool in an Alteryx workflow. The Powershell script would save the attachment from an email, save it to local directory, and then Alteryx could reference that file as an input. I'm not sure how familiar you are with Powershell, but here is my script.
Add-Type -Assembly "Microsoft.Office.Interop.Outlook"
$Outlook = New-Object -ComObject Outlook.Application
$Namespace = $Outlook.GetNameSpace("MAPI")
$inbox = $NameSpace.GetDefaultFolder(6)
$targetfolder=$inbox.folders |where-object {$_.name -eq "Reports"}
$targetfolder.Items | foreach{
$_.attachments | foreach{
$_.saveasfile(('C:\users\Joben\desktop\Test.xlsx'))
}
$_.Delete()
}
Also, you really don't even need the input tool. You can bring the file directly in using the read results within the configuration of the command line tool. It would look like this.