I’m currently performing Excel operations. I’ve successfully executed the “Join DataTable” operation and applied an “If” condition. However, I’m encountering an error when attempting to add a data row to the DataTable.
Hi @chandrakala.productanalys ,
Can you share input and expect output
or
your image about your activity and error?
regards,
Hello @chandrakala.productanalys
- Ensure column names and data types match.
- Check for null values and column constraints.
- Verify the destination DataTable is valid and not empty.
- Avoid concurrent access to the same DataTable.
- Double-check the activity configuration.
- Implement error handling to capture and address exceptions.
Thanks & Cheers!!!
Check if the data row you’re trying to add is properly initialized and contains data. If the data row is null or empty, you will encounter this error. And the data row should be an array of objects matching the schema of the DataTable.
can you check that dt_newdatatable variable scope
yes.Within Scope only.
It may happen if datatable has empty rows
make sure that dt_newdatatable variable has been properly initialized before starting the add data row
if it initialized then can you debug and check that it has having rows or not
debug and check what u find in dt_newdataTable
Rows containing '-- values will be considered as empty rows in the DataTable
Check all the values in the arrow row that you are passing is not empty and the length of the array row must be equal to columns length of the datatable. And you should have used an activity like “Build DataTable” or “Read Range” to create the DataTable before attempting to add a row to it.
If all are perfect but not working then use multi assign activity to store the current row values in separate variables then pass those variable in the add data row activity.
Can you try with
new object before {} in array row value
Hope it helps
Rows containing ‘–’ values will not automatically be considered as empty rows in a DataTable.
@chandrakala.productanalys
By using Build data table activity
You can try this method but it might be lengthy
-
first create a new row for your datatable
-
Add values to your row
-
Add that row to datatable
Check that the no. of columns in the build datatable must be equal to the array row length in the data row activity. And give the values length as -1 (max length) for every column in the build datatable activity to avoid the string length issues.
@chandrakala.productanalys