Write cell activity not working in dt

Team,

I am trying to read a column in dt
For a column , cell value length >12 should be editted to keep only 12 digits (counting should be done from last)

Eg. If cell value is 1234567897654 then 234567897654 should be left after editing and append 10 in each those cells so the final value will be 10234567897654

Appreciate quick responses with solutions no links to read articles please I have tried nothing is working

@Reni_Sweta Try below solution

Assign str_data = “10”+str_data.Substring(str_data.Length -12)

image

1 Like

I tried exactly same thing but didn’t worked when writing value to a cell
image

ProductValid2.Substring(ProductValid2.length-12)
“G”+(ValidDataTable.Rows.IndexOf(CurrentRow)+2).ToString

@Reni_Sweta Can you please share the error message

no error message the variable is getting updated but when trying to pass variable in write cell Input and checking output dt then it is not reflecting

@Reni_Sweta Are you using inside for each loop?

yes
image
image

@Reni_Sweta Is it possible to share your workflow

Hey @Reni_Sweta

Kindly try this,

"10" + new String(ProductValid2.ToCharArray.Skip(ProductValid2.Length - 12))

Thanks
#nK

what will be variableType of ProductValid2?

String, do you have any other type ?