I need to Update the Value in the Excel

HI Team,

I hope, Everyone doing well.

Today I have come up with a scenario, I have a excel data, In that excel data I have 3 columns are there which mentioned below.

I that Which ever column is null we have to filter that and in front of process name I need to update the end time how to do that can any one have IDEA

Process Name Start Time End Time
CHI 22:00 24:00:00
TPA 06:30 07:30
KAAAN 13:00 14:00
TPA 03:50 07:13
CHI 23:00 03:00
KAAAN 23:00

Hie @copy_writes i"m attaching the screenshot for this scenarion how you can check this if the column End time is empty or not or which cell is empty and write the time on that
image
save data as -dt1
image
use for each and if condition to check column is empty or not

CurrentRow(“End Time”).ToString = “”
image
this is how you write data in cell and increase the cell num also and the currentindex is a variable of integer which i create in for each row activity

cheers Happy Automation

Hi @copy_writes

Try this

DT.AsEnumerable().Where(Function(row) String.IsNullOrEmpty(row("End Time").ToString)).ToList().ForEach(Sub(row) row("End Time") = row("Start Time"))

Regards,

DT.AsEnumerable().Where(Function(row) String.IsNullOrEmpty(row(“End Time”).ToString)).ToList().ForEach(Sub(row) row(“End Time”) = row(“Start Time”))

In the above code where can i pass the end time Value??

@copy_writes

endTimeValue = "YourEndTimeValue"

DT.AsEnumerable().Where(Function(row) String.IsNullOrEmpty(row("End Time").ToString)).ToList().ForEach(Sub(row) row("End Time") = endTimeValue)

Regards,

But I need:

If process name is match and need to check the start time is empty or not and if start time is not empty it should not enter if start time have value and end time is having value then need to enter the endtime Value.

@copy_writes

DT.AsEnumerable().
    Where(Function(row) Not String.IsNullOrEmpty(row("Start Time").ToString) AndAlso String.IsNullOrEmpty(row("End Time").ToString)).
    ToList().
    ForEach(Sub(row) row("End Time") = row("Start Time"))

To Update the “End Time” with a Specific Value:

DT.AsEnumerable().
    Where(Function(row) Not String.IsNullOrEmpty(row("Start Time").ToString) AndAlso String.IsNullOrEmpty(row("End Time").ToString)).
    ToList().
    ForEach(Sub(row) row("End Time") = endTimeValue)

Regards,