I have one challenge and its problem in excel file

hello I hope some help me
I want to do automation in email send mail through SMTP
Step1: extract data from the database
Step2: put that into excel file
Step3: read the data from the excel send it in mail

Hear I can send the email read the data from excel but hear the problem is I want to send the data who are not getting the mail in my database every day new data come for them only we have to send the mail, not for the older one so I plan that filter the data hear I want to add the column to excel after extract the data from database and after sending the mail I will write in that column success.

So my problem is I extract the data from the database every day in that old data also there I don’t want to send the mail to them after I write the success in a new column what I add the data table using add column activity.

Every day we extract the data but don’t sen the data to older data for that what can I do?

Anyone help me!!! please

Hi @Chethan_P,

Two Suggestions ;

  1. we can create a separate excel file for each Day or say Each run - The best way to do that would be whenever we download the Data from Database and save - while saving - the excel name is appended with datetimestamp something like this : Input_05_08_2020_12_44_03.xlsx . This way we will always have a new excel.

  2. We can add a Status column in the Excel and in the Foreach loop - After each transaction - we update the column value using write Cell . This same can be accomplished with the use of DataTable by adding a Column i the datatable and updating the column dynamically.


1 Like

yes i did the second option but the thing is every day new data is come we want to send the email to new data only not old data and i face the issues every day we re write the excel sheet what should i do for that.

So when you are sending the email , we put a filter on the excel where status is not complete and then we send the email

Why don’t you read only the new data from the database?
Is there any ID you could use to select only new records?



yes, new id generated but we have date column also there we can take the data according to the current date? using execute query.

So what’s the problem? :slight_smile:

I can imagine following approach:
1/ take ID of last processed record (e.g. from the excel) - lastID
2/ select from database records where ID > lastID
3/ send email for new records in excel


1 Like

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