To Replace Blank Value in Column

Hello Team,

We have excel file with below column format

image

How to we add 1 for ENA if it contains Blank as below

image

Thanks in Advance

Hi @NISHITHA,

I have created the workflow for the same. It is giving accurate output where it gets the empty cell and meet all your requirements.

Reference workflow attached which will give the empty and you can store the cell number in array which will help you to write the data using Write Cell Activity
Main.xaml (14.2 KB)

Thanks in advance,
Jayavignesh G

Thanks @Jayavignesh_G for sharing the reference

Hope this will be helpful and kindly it as solution

@NISHITHA
Through Invoke code activity we can replace null value with “1”;

For Each row In dt1.AsEnumerable()
If(String.IsNullOrEmpty(row(0).ToString)) Then
row(0)=“1”
End If
Next

Cheers!!

Thanks @sasi_poosarla

Can we use Linquery ?

@NISHITHA

you can also try this, if you have only few columns than this useful

dt.AsEnumerable.Select(Function(a) dt.clone.LoadDataRow(new Object(){a(0).ToString,if(a(1).tostring.Equals(""),"1",a(1).ToString)},False)).CopyToDataTable

Hi @NISHITHA

you can use below expression in for each row in datatable activity

Assign activity:
row(“ENA”) = If(String.IsNullOrEmpty(row(“ENA”).ToString()), 1, Convert.ToInt32(row(“ENA”)) + 1)

please refer below workflow:

How to Update Data Column Values of a Data Table | Community Blog

As discussed in the linked Blog, there are different approaches for this use case (e.g. datacolumn.Expression)

Balancing Black-Boxing and LINQ will come to a lower rating for a LINQ Approach for this filtered row and single column update

2. Case: update column values on specific data rows

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