Place String Variable value into Datatable Column

Hey everyone, I’m guessing this is an easy question, but I have a datatable with two integer columns; the first one auto-increments and the second one I want to pass values to each time I go through a while loop.

I have a variable ‘vDays’ that I want to put into the datatable ‘vMyDatatable’ column number 2. How do I do this, and can it be done through an assign variable? I get an error with an assign variable when using vMyDatatable(“Column2”) = vDays .

Hi @cssc

If you want to set a variable into an integer column, you need convert it to integer type beforehand.

1 Like

@cssc You are using a wrong expression. Your Expression should be as follow:
vMyDatatable.rows(rowNumber).item(“Column2”) = vDays
Make sure vDays variable is type of Int32 otherwise use CInt method to convert it into integer as your datatable column will only accepts Integer

1 Like