Uipath append activity only take the last row

Hi, I’m a beginner in UiPath for the last 2 months. Question is, I extracted data table from multiple pdfs. According to local panel, it extracted the whole table. but when i append into a single excel sheet, it only appends the last row starting from the second pdf. Sorry, can’t show data due to data confidentiality. Thank you.

Note : I removed the first row because it did not detect it as header. So I build a data table for header.


image

Hi @farrissya.z ,

From the Screenshot we can see that there are two datatables being used. Isn’t ExtractDatatable variable the one that needs to be used in Write Range activity ?

you need to use dt_new for the append as mentioned in your scenario

the first write range is only to add headers. while the second is to add the data

Hi @farrissya.z

Use build datatable activity and write range activity before the loop.

1 Like

Hi @farrissya.z

Could you tell what was the output of ExtractedDatatable.Rows.Count value in log message ?

Hello @farrissya.z

<ExcelApplicationScope>
    <WriteRange Range="A1" DataTable="[yourDataTable]" />

    <!-- For Each PDF -->
    <!-- Extract data into 'extractedDataTable' -->

    <WriteRange Range="A2" DataTable="[extractedDataTable]" />
</ExcelApplicationScope>

Thanks & Cheers!!!

1 Like

it just to display the table row count. for the first pdf, it has 3 rows

i just realized why it take the last row only. apparently, for the first pdf, the table extraction extracted the header as row. so i deleted the first row and added a new header. and i found out that for the second pdf, the table extraction activity did recognize the header. but, i already deleted the first row. that’s why i have only the last row. is there a way to filter if the first row have the header or not so i can delete the first row?

@farrissya.z ,

Could try with Filter Datatable activity with reference to the First Column being header name and then perform removal of the rows.
image

1 Like

I’ll try this first. thank you!

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