I have a variable ExtractionResults which contains the extracted results from a PDF document. In it I have a table called “Items”. The table items has a field unit price. Post extraction is done and before presenting to the validation station. I want to calculate the total(addition) of unit price column.
Example if the table contains 5 rows with values 8.25 then total I should get is 41.25 as total then I will store it to a new field. First problem here is getting all the values of that column from extractionresults and summing them.
You need to export the extraction results to a dataset first by using “Export Extraction Results” activity. dataset will have multiple data tables. Example dataset(0) will acquire the header data and dataset(1) will acquire the table data. then you can use the below syntax to get one row value from your table
dataset.Tables(0).Rows(0)(1).ToString
you can put a loop and increase your row number to sum the unit price column
If suppose I got the total amount example 2564, now if I want to assign this value to a new field which is defined in Taxanomy already field name Line Total. How can i do that?
Find the column number for your Line Total column in dataset.tables(0) then , apply for each current row in that data table take an assign activity save like in the below screenshot
Once I am able to get the total which I am able to get using extractionresults logic you told and summing it up.
After that the total which I got I want to assign it the field of extraction results like I am doing below But getting error - Index was out of bound of array.
as mentioned in your other topic. we would prepare a datapoint and then assign it to
io_ExtractionResults.ResultsDocument.Fields(FieldsDict(“Level Total”)).Values