HOW TO DO WRITE RANGE IF MEET CONDITION

Hello guys, i have data table with 2 column which is name and email. The data for email column have mix value, there is empty value and there is value in that column. I want to write to that datatable to another excel file only for the empty value in email column

  • I want to keep only the row have empty value in email column

Hi @Kelvin1,

Welcome to the UiPath Community!

My approach would be building a data table for writing into Excel. For example, I will name my data table variable as dt_ForExcel and put it on Build Data Table activity.

Then I will loop on data table with data by using the For Each Row activity.

Then inside the loop, I will add an If activity and then put a condition: Not String.IsNullOrEmpty(row("email).ToString)

And then add a Add Data Row activity on the Then part to add the Row details on dt_ForExcel

After the loop is done then I will add a Write Range activity for Excel.

Hope this helps.

Kind regards,
Kenneth

hi @kennbalobalo thank you for the answer, when i tried the condition in if activity the error appear like this
image

Hi,

It should be Not String.IsNullOrEmpty(CurrentRow(“email”).ToString)

thanks its worked

great. kindly mark the solution as it will help others as well. have a great day!

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