Find email with specific attachment

Hi guys!

I am using the get outlook activity to get unread emails, after I have to go through the list and find a specific email that contains an excel file with specific columns.
How can I do this?

1 Like

Kindly have a view On this

Cheers @tais.matos

1 Like

@Palaniyappan ,

This topic helped me verify the attachment with a specific extension, but I also need to validate if the attachment template is what I need.
For example, I need to check if the spreadsheet has the columns “Product Name” and “Price”, if yes, the robot saves the attachment and follows the flow, if not, validate the next email.
Any ideas on how to do this? I found no topic about.

1 Like

This can be found only when the excel is present in our folder right
And if that has to be in our folder it must be downloaded

So the sequence be like this
—save the attachment to a folder
—then use a assign activity like this
arrFiles = Directory.Getfiles(“yourfolderpath”,”*.xlsx”)

Where arrFiles is a variable of type array of string

—now pass the variable arrFiles as input to For each loop activity and change the type argument as string in the property panel
—inside the loop use a EXCEL APPLICATION SCOPE and a READ RANGE activity and get the output with a Variable of type datatable named dt
—now use a IF condition
**dt.Columns(columnindex).ColumnName.ToString.Contains(“Product Name”) AND dt.Columns(columnindex).ColumnName.ToString.Contains(“Price”)

Where column index starts with 0 for first column Assuming that we know the position of the column

If true it will go to THEN part where we can make use of that excel file

Cheers @tais.matos

1 Like


It worked perfectly, thank you so much for your time and help :smiley:.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.