Append file CSV doesn't write the data

Hi,

I’m trying to append a file from filtrated value.

Everything work find but rather then writing the row value it just write text and 1.

Tx

Hadrien

Your test variable isn’t being updated. Make sure you update it for each iteration.

I don’t understand.

The variable is updated. In fact when I look at the queue item in orchestrator the data are correct.

All I want is to write the rows who match the if condition in an excel file whith an append activity but i can’t find how.

Tx

From your screenshot, the test variable is being written to your CSV. You can verify what’s in test by setting a breakpoint at the Append Range activity and looking in locals to determine what the value of test is.

The test variable is an empty data table where I try to write the rows from the dt_workitems who match the condition.

I also try this but it’s worth

Your workflow isn’t writing data to the test variable. You’ll need to do that before you append the range.

How can I do that ?

I don’t understand why I should write data before appending it.

For me when I use the append activity, it write the rows at the end off the file ?

If my solution is not the good one, can you explain me how can I write the filtrated lines in an excel file ?

tx

What I mean is that your test datatable must contain new data whenever you write it to the Excel, so you need to get the data into the datatable first and then write to the Excel file.

Ok, can you explain me how to do that ?

Use the Add Data Row activity to add the row to your test datatable. You’ll want to add an array item of row.ItemArray. Make sure that the test datatable is local to the scope of your loop, or you’ll end up appending the first row, then the first and second, then the first second and third, etc, where you only want to append each one time.

When I do this I got and error message…

You want that in the ArrayRow field, and as row.ItemArray. You’ll get a different error if you don’t add the .ItemArray to it.

If I do so, all the workflow goes down…

Like I said, use the ArrayRow field not the DataRow field.

Can You explain me what’s the deference and why should I use this one and not the other ?

I still got an error, it’s hopeless

If I move the data table inside the loop i dot another error…

I can’t see the end of the tunnel …

Uploading: Screenshot 2020-03-23 at 19.58.32.png…

It’s my last error

Add a Build Data Table activity before Add Data Row. Using that, define the columns which are to be inserted.

Do not add data in the Build Data Table activity; just create the columns and set their datatypes.