Putting data from email table into SQL insert statement

hi, i need help to extract a column of a table from Outlook mail and putting it into an SQL insert statement.
thank you.

@Kate_Tan To convert the table in the Mail Body into a Datatable and insert it into a Database. First the Conversion of Outlook Mail Tables into Datatables need to be seen into. So there are some activities and methods by which you can do this. Check one of the ways in the below post :

i am able to extract it into an excel sheet, however, im wondering if there’s a way to just get one column and put it into a sql statement.

i want to extract the second column into like a statement without going in to excel or anything… eg “insert Vacuum Cleaner into system”, then replace the Vacuum Cleaner with Blender, and so on.

@Kate_Tan Have you used the Database Activities before ? If you have used then you know you can use the Execute Non Query Activity to insert the values one by one into that particular column of Table in the Database.

To Read only the Column of the Extracted Table in Excel Sheet. You can use Read Range Activity to read the Table as a Datatable, then you can only keep the Second Column using this Expression :

DT = DT.DefaultView.ToTable(False,“Product”)

Where DT is the Output of Read Range Activity.

Then You can use a For Each Row to Loop through the Column Values One by one and Insert the Values into the Datatabase Table.

sorry, i didn’t quite understand what you’ve said

@Kate_Tan Is the Table Extracted and Stored in an Excel Sheet ? :sweat_smile:

yes but im wondering if there’s a way to directly form a statement without using excel.

is there another way i can contact u for help? maybe it’ll be easier to explain to u…

@Kate_Tan Actually The Output of this xaml file gets you a Datatable, which you can use directly instead of saving it to an Excel File and reading it again

the part where i save mail message?

@Kate_Tan After The Extract Structured Data Part which outputs a Datatable.