Store variable value in Data Row

I’ve created a project that does a simple calculation and stores the result in a variable.

It then repeats the calculation on increasing numbers by incrementing +1 each loop, during a condition until it reaches a certain number.

I’d like to store the result of each loop somewhere, and was thinking a simple datatable, with just 1 column, however I’m struggling with the syntax in Add Data Row.

After one loop of the calculation is complete, the result is stored in a variable called ‘CurrentAnswer’ (double, as it has decimals).

I’d like to store the value of ‘CurrentAnswer’ in a row of a datatable, then loop through and store the next value of CurrentAnswer in the next row and so on until the condition mentioned above is met.

The datatable is called DT, with 1 column called ‘Result’ (type – double)

What syntax do I use in the DataRow properties of the Add Data row activity?

1 Like

@aod

I think much simpler would be to store it to the List, you can use simply activity add to collection.

If you realy want to store it to the DT, then you have to for each iteration create a DataRow Object with structure, and fill the first cell with your value. Then add this row to the DataTable.

Fine
in the add data row property panel
–along the datatable property mention the datatable name and make sure that the type of that column in the datatable is also double
–in the ARRAYROW property mention the variable name as a array
if we have one column then mention as {CurrentAnswer}
Or if the column of the datatable is in string type then mention as {CurrentAnswer.ToString}

hope this would help you
Cheers @aod

1 Like