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

I get the error below for Add Data Row activity:

This is what I want to add:
image

… and this is the data table:

I basically add 4 elements in 4 columns. What I’m doing wrong?

I attached the whole workflow:EXAM_ReFramework_Vendor_CezarCardon 09042020.zip (2.6 MB)

@Cardon_Cezar Make sure you are using the Same Datatable.

1 Like

Hi @supermanPunch

Looks like the issue is here:
image

In the workflow with Add Data Row, my intention is to reset the content of the data table (in order not to overlap with content of other Transaction Items). However, looks like I delete everything in that data table, including the header, so the number of columns become 0.
image

What is the best practice to delete all rows of a data table, but to keep the header?

@Cardon_Cezar If in_OutputDT has the Data and you just want to Keep the Schema/ Headers of the Datatable and remove all the Rows. You can Try this Expression :

in_OutputDT = in_OutputDT.Clone

Check and revert back if this is what you needed.

and Congratulations on the Certificate :smiley:

Hi @supermanPunch

I made the change
image
image

Now I get this error:
image

Should I set in_OutputDT.Clone also as input in Add Data Row?

@Cardon_Cezar From the Previous Screenshot, I thought you were Supplying ArrayRow Property and not DataRow :sweat_smile: , Can you Supplying the datarow in the form Array Row Data and check

1 Like

@Cardon_Cezar Actually I guess the workflow you had was proper, Only I think you need to remove the Assign of in_OutputDT = new Datatable inside the Validate_VendorTaxID workflow, Since you’re passing the new Build Datatable Output as argument to the Workflow. The Datatable should have the Schema and it Should be empty.

1 Like

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