EXCEL COLUMN 2

HI ,

I have a scenario in excel where if data is present in column AI AND AK then its fine AND IF NOT THEN SS HAS TO BE TAKEN AND SEND TO CONCERN PERSON VIA MAIL

Hi @poojaskyrathore

→ Use read range workbook activity to read the excel and store in a datatable called dt.
→ Use for each row in datatable activity to iterate the each row in dt.
→ Insert If condition inside for each and check the condition

Not String.IsNullOrEmpty(CurrentRow("AI").ToString) AndAlso Not String.IsNullOrEmpty(CurrentRow("AK").ToString)

→ In else block take an assign activity to store the SS column value.

- Assign -> MailID = CurrentRow("Column name of SS").toString

→ After assign activity insert send smtp mail message or send outlook mail message activity to send the mail to the recipient. Pass the MailID Variable in the To field.

Check the below image for better understanding,

Hope it helps!!

@poojaskyrathore

Not String.IsNullOrEmpty(CurrentRow("AI").ToString) AndAlso Not String.IsNullOrEmpty(CurrentRow("AK").ToString)

Then

Else

 Send outlook mail messages activity

Hi @poojaskyrathore

Check the following

Not (String.IsNullOrWhiteSpace(CurrentRow("AI ColumnName").ToString) AndAlso String.IsNullOrWhiteSpace(CurrentRow("AK ColumnName").ToString))

image

Hope it helps!!

THAT equals is referred to ?

Sorry @poojaskyrathore

I have made some wrong condition statement I have edited you can check now.

You are asking to send the screenshot right, which screenshot you want to share in the mail.

Not String.IsNullOrEmpty(CurrentRow(“Customer Name”).ToString AndAlso Not String.IsNullOrEmpty(CurrentRow(" Org Inv Amt ").ToString)

this is showing me error

@poojaskyrathore

Not String.IsNullOrEmpty(CurrentRow("Customer Name").ToString()) AndAlso Not String.IsNullOrEmpty(CurrentRow(" Org Inv Amt ").ToString())

Please Try this it will work for You

@poojaskyrathore

Best would be to use a filter datatable activity

So read the data into datatable and then use filter datatable and filter the columns you need with empty…

Then you have all rows where both aAI and AK are empty…just use a for loop and send email inside it…you need jot do the if condition inside it

Also if you want to do directly from excel…then you can use filter table in excel activities also and then just loop through the visible rows using for each row in excel activity…then also you would get only the required rows and use send email inside loop

So steps would be

  1. Filter datatable for empty AI and AK
  2. For each activity
  3. Send email

Cheers