Overwriting Existing rows Build Data table - Add row activity

Hi,

Just want to know the behavior of add row activity to build data table.

Seems like it is overwriting the first value with the latest value in the data table.

Want to know the reason.
Is this reason as i am keeping only one row in the build data table , if not please let me know what to do keep it from overwriting ?
image

1 Like

The build data table activity will assign a datatable to a variable with exactly what you setup (columns and rows if desired). Each time it executes it would overwrite the variable in the output property with the datatable you setup in the Build Data Table wizard.

You can use the add row activity to insert a single row of data to the datatable once it has been built (or created using other means).

If you were to execute the build activity again (assigned to the same variable) after the add row activity you would not see the row you added in the datatable anymore because the variable would have been reset to the configuration in the build activity.

Hope that helps provide some clarity to these activities.

1 Like

Hi @kavinnatarajan

Fine
Usually add data row can be used when we have a set of data either in a array form or as individual variable or as a datarow, we can add those to a existing datatable
But when we use a add data row to insert a row to the datatable, it will insert at the end of the datatable as a new row only
So here you have used a build datatable to create a datatable and add a row using add datarow activity
It seems like the image implies that build datatable has no row in it so when you add a row with add data row it will get added to the first row (looks like overwriting) but not so…
To check add a data in those two columns and then use add data row mentioning the array row property as {“string1”,”string2”} and mention the datatable as input
It will add to that datatable as a new row, for sure

Hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @kavinnatarajan

2 Likes

Hi @kavinnatarajan

The add row activity doesn’t overwrite the row in the data table. If it is overwriting i think you should check where have you used build data table activity. The “build data table” activity might be getting initialized every time you are using add data row activity. Try changing the scope of build data table.

1 Like

So any issues to be discussed further @kavinnatarajan
Cheers

1 Like

Thanks a lot for your clarification :slight_smile:

No worries
Cheers @kavinnatarajan

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