Concat a string for to the existing cell values of a column at once

Hi Team,

How do we Concat a $ for example to the existing cell values of a column at once.
The data is huge.

@MANISHA_V_ARORA - c# or Vb.net ?

If I give invoke code for vb.net will that be ok?

@MANISHA_V_ARORA
give a try on

  • add a new datacolumn (name dollarvalue) ti the datatable
  • set the expression property: YourDataTableVar.Columns(“dollarvalue”).Expression = “‘$’+[ColNameWithValue]”

grafik
Input, Output:
grafik

In case of origin column is unneeded, we can:

  • remove it e.g. delete datacolumn, filter datatable or dtData.DefaultView…
  • renaming dollarvalue column: dtData.Columns(“dollarvalue”).ColumnName = “OldColName”

have also a look here on how it was done with the url:

1 Like

Yes @prasath17 VB.Net code would do

@MANISHA_V_ARORA - Here you go…

Invoke Code

DtInput.AsEnumerable().ToList().ForEach(Sub (row) row("Amount") = "$" +row("Amount").ToString)

2 Likes

Why have you added .tolist()?

@kumar.varun2 - Taking each row and convert it to a list …and then looping each row to do a necessary update…

Sample video here: Updating single / multiple columns using single of code in UiPath - YouTube