Error:Input array is longer than the number of columns in the table



Hey everyone i am trying to read column data from excel and then replacing some text and then using invoke method and then add row activity of data table but i am getting this error

“Input array is longer than the number of columns in the table”

i have tried ones on different kind of data at that time there was no error!! like transposing column to row.

My goal is to make a new datatable of formated data and then sort it ASC or DSC .

Please see my attached file.

Nara (9.2 KB)


Hi @Nara

Your workflow is not correct.
Please make below changes in your workflow.

  1. Use ‘Build DataTable’ Activity outside Foreach loop.
  2. Inside ForEach
    a. change the value of desired cell/cells.
    b. Use AddDataRow activity to add row in updated table(Input->Item array->row.ItemArray)



Thanx @Vitan for the help but still giving the same error

1.Read excel
2.Build datatable (outside for each)
3.for each row in read excel datatable
。Inside for each i changed cell data.
。Then i used Add Data row in which i used —> row.ItemArray in Input for ArrayRow.

also disdabled invoke method which i was using earlier


Input array is longer than the number of columns in this table

Hi @Nara,

You are getting that error because you have only 1 column in output table and you are giving a row of 11 items as input in Add DataRow Activity. Please provide ArrayRow property value as {row(11)}.

I have done the required changes and working fine for me.
Also in Write range you need to give file name as ‘filename.xlsx’



Thank you @Vitan for taking the timeout ,i am confused between list and array how to use them

can you share the workflow??

I did my changes like this currently it doesn’t give error but print the same (14.1 KB)



Hi @Nara,

I saw your workflow everything is correct other than Invoke method. Why do you need an array or list to export data from one table to another. Please comment it out.
To sort datatable you may refer Upath - Sort Datatable

Also I have attached my workflow for reference.test123 (2).zip (15.3 KB)


ThankYou @Vitan i was using invoke since i saw an example of transposing column to row ,and i thought we have to use it every time.

Thanks for clearing my doubts and sharing use full info .