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.
dt.Select(“[Col2] like ‘% %’”)
This will give you list of data rows then use for each then check if condition
row[Col2]=“” then take assign activity and give like this
dt.Rows(dt.Rows.IndexOf(row))(“Col2”)=“NA”
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.
Gokul001
(Gokul Balaji)
September 22, 2022, 11:32am
4
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
@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
system
(system)
Closed
January 31, 2023, 12:06pm
11
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.