ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Running data from Mailbox

tgill1
7 - Meteor

Hi,

 

I have various spreadsheets (all of the same format) in a folder in my Outlook, sent by various different people. Is Alteryx able to read my mailbox and extract the Excel attachments within the email and process them? If so, what's the quickest / easiest way to do this?

 

Thanks

afv2688
16 - Nebula
16 - Nebula

Hello @tgill1,

 

there is an outlook connector to check your inbox. you can download it from this article and try it out:

 

https://community.alteryx.com/t5/Engine-Works-Blog/Outlook-Input-tool-Created-with-the-Alteryx-SDK/b...

 

try it out and let us know!

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

DrewDavis
11 - Bolide

You can trigger python code from Alteryx. Super quick and easy! 

 

Below is the python code I created for my office.  i The sub_today / att_today is where you can put the file name(s) you want to extract, or you could remove and pull everything in a folder. Let me know if you have any questions.  You should be able to have the setup complete in a couple of hours.  

from win32com.client import Dispatch

import datetime as date

import os



outlook = Dispatch("Outlook.Application").GetNamespace("MAPI")

inbox = outlook.GetDefaultFolder("6")

all_inbox = inbox.Items

val_date = date.date.today()



sub_today = 'test’

att_today = 'test.xlsx'

for msg in all_inbox:

    if msg.Subject == sub_today:

        break



for att in msg.Attachments:

    if att.FileName == att_today:

        break



att.SaveAsFile(os.getcwd() + '\\new.xlsx')

 

 

tgill1
7 - Meteor

@DrewDavis I'm afraid I get an error when running this code:

tgill1_2-1582220726537.png

Do you know how to fix this or what I am doing wrong?

 

thanks!

DrewDavis
11 - Bolide

Can you please post the full code. The sub_today = 'scorecard' is correct by itself,  so something else is creating the issue for that line. 

Labels