Replace empty row with string values

hi,

i have code to find and replace “mohan/any” string value into “Retrieved and added to Queue” in the column-> Status.
as you can see below.

dt.Select(“Status=‘mohan’” ).ToList().ForEach(Sub(row) row(“Status”)=“Retrieved and added to Queue”)

But i need to replace with empty row with this value–“Retrieved and added to Queue”

how to replace empty row values.

Hello @manipreethi410

Please check whether the below post can help you.

Thanks

This contains many activities the code should have in single line, which like I have mentioned above.

Where ever I used Mohan, I just have to replace with null value here am facing the issues,

Am not getting how to pass null or empty row here in the code.

Please help me with that.

Hi @manipreethi410

Can you share the sample input and Output excel file

Regards
Gokul

Hi @manipreethi410

Try this code for replacing the empty to a given string in the invoke code activity

dt.AsEnumerable.Where(Function(row) String.IsNullOrEmpty(row("Status").ToString)).ToList().ForEach(Sub(row) row("Status") = “Retrieved and added to Queue”)

You need to pass the same dt in the arguments

Regards
Sudharsan

1 Like

Check the above one or the below one

dt.AsEnumerable.Where(Function(row) String.IsNullOrWhiteSpace(row("Status").ToString)).ToList().ForEach(Sub(row) row("Status") = “Retrieved and added to Queue”)

Regards
Sudharsan

1 Like

And you need to change the direction to out @manipreethi410

thank you.

1 Like

thank you.

1 Like

@manipreethi410 If your query resolved kindly mark your solution and close the topic so that it will be helpfull for others

Regards
Sudharsan

1 Like