Add Data Row: Input array is longer than the number of columns in this table error

Hi all,

I am getting this error, Add Data Row: Input array is longer than the number of columns in this table.

VB, Windows I am using here.

What I should do. Please help me.

We recommend to check the Array From ArrayRow that the number of items is matching the count of datacolumns.

For a more detailed analysis we would use the debugging panels:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

Hi @ppr, not able to resolve the issue what i should do

as mentioned:

  • set breakpoint at the Add Data Row Activity
  • Debug and get paused
  • Use the immediate panel and type in: Dt.Columns

Now compare the number of columns and your array used for the add datarow. The number of array items has to be the same as the number of columns : Looking at the error, it seems you are provide more values to your add datarow activity than number of columns you have in your datatable.

For example lets say you have datatable with Header Name & Age this two columns, but while using Add Data row activity you might be passing at least one extra arguments lets say {“Avi”,12,“Mumbai”}.

try to match the count & then pass argument, it should work

Hi @avinash_ghanwat1 , Actually same workflow working fine in windows legacy, but not able to run in windows. What to do.

Please guide me on this. : In that case just check all the package version sometimes that might cause issue, & even that matches then disable that activity & try to add again the same activity & then check whether its working or not.

Hi ,

If the above is being done after the conversion in Windows, then could you try removing the Add Data Row activity and add the activity again and configure with the same values and check again?

Also just check in the Debug Panel, the number of columns in the Datatable and the number of values you have added in ArrayRow Property.

when running in Windows compatibility we would recommend to add new Object() before the {---}

new Object(){APS1, …}

Ensure as already above mention that the number of items within the array is the same as the count of data columns

Hi @ppr , @supermanPunch , @Yoichi even after adding new Object(), in add data row same error I am getting.

Same workflow working fine in Windows legacy but not in
What changes I should do. Please help me on this.