Update Datatable Rows

I have a datatable.I want to change all id format.
Example id format: ab123456 i use substring for this.
row.Item(“id”).ToString.Substring(2,6)
but
How can i update datatable ids to new ones?

Hi @ekaraoglu,

Inside a ‘for each row’ of your datatable, use an ‘assign activity’ to update new values to each row like
row("id)= row.Item(“id”).ToString.Substring(2,6)

Warm regards,
Nimin

1 Like

Hi,

The above solution perfectly works,

if you don’t know how many letters and digits will be there in “id format” then you cannot use substring as you are passing the values, in this scenario you can use assign statement inside a for each row and use the below condition.

row(“id”)=Regex.Replace(row(“id”).ToString,"[^0-9]+","")

1 Like

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