How to Handle Split Documents with Same Class in UiPath DU?

Hi everyone,

I’m using Intelligent Keyword Classifier in UiPath Document Understanding to classify documents inside a PDF. Sometimes, a document spans multiple pages, but those pages are not next to each other in the file.

The problem is: when the classifier detects the same document type multiple times, only the last one keeps its extracted fields. The fields from earlier pages get overwritten or lost.

How can I keep all the extracted fields from documents with the same class as a single datatable output, even if their pages are not consecutive?

Thanks!

Hi @Youssef_Barj

Use a Group By or loop through ExtractionResults:

For Each result In ExtractionResults
dt = result.ExtractedDataTable
If mergedTables.ContainsKey(result.DocumentType) Then
mergedTables(result.DocumentType).Merge(dt)
Else
mergedTables(result.DocumentType) = dt.Clone()
mergedTables(result.DocumentType).Merge(dt)
End If
Next