Replace values of a column of datatable with another value

try to avoid the argument names are the same like variable name
it will maybe not fix the issue but avoids side efeccts.

When you debug is used datatable in a conditionas as expected?

Sorry, but I could not understand you correctly

set a break point on invoke code
debug and get paused
inspect the datatable in locals / watch / immediate panel

In case of this type of work is new to you refer also to the debugging course UiPath Academy for getting introduced on this topic.

Withthis anaylsis you can check if used datatable is in a condition as expected (e.g. correct datacol structure, filled with data…)

I am already executing my code in debug mode and cross verifying it in locals and watch window. The structure of table is correct. I have doubt that I am not representing empty cell in string format correctly. I also used string.Empty instead of “” but all in vain.

lets explore with following: wrap the code in invoke code in a try catch block (inside the invoke code activity) then we got details from issue

1 Like

As a quick alternate we can ommit try catch within invoke code code and wrap it outside with a try/catch:


logging the inner exception gives us the details what did happen inside invoke code:

So with this techniques you can inspect and e.g. check your doubts on:

Coming back to the origin question maybe following defensive code will do it:

If(isNothing(Row(“Standard”)), “0”, Row(“Standard”).tostring.Trim.Replace(“X”,“1”).Replace(“”,“0”))

Thanks for your effort and time:).
So, I enclosed it with try, catch and I got this error:

String cannot be of zero length.
Parameter name: oldValue

If it can’t be zero length then how can I proceed?

please show your implementation details, thanks