Extract contents of a Table from Io_ExtractionResult Variable

Hi All,

Need urgent help!!

I have a variable Io_ExtractionResult which contains result gathered from Data extraction scope activity of UiPath, The data extracted is from an invoice.

I want to extract the result of a table cell to a variable example value from row 1 column 1 to a variable i define. I tried using some commands like.

io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(0,ItemsDict(“Style”)).Values(0)
where ItemsDict is a dictionary.
but I am always getting the column name only.

Is there any way where without using the “Export extraction results” activity I can directly access the table contents and store them to some variables the table may have 2 3 rows.

Thanks

@Dhruvi_Arumugam,

Tried this solution?

Thanks,
Ashok :slight_smile:

in such a case we recommend:
use the immediate panel

Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

and prototype the access by increasing part statements and result explorations. So it will help to understand the object structure.

Start with:
io_ExtractionResults.ResultsDocument.Tables(0).Values(0)
then:
io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(…

Also feel free to explore the offered JSON

Hi @ppr

Yes I am using the immediate panel only.

For the usecase I first checked the number of rows in the table using below query -
io_ExtractionResults.ResultsDocument.Tables(0).Values(0).NumberOfRows
for which I got Output - 3. This 3 is including headers as well

Now I accessed the value using below query -
io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(2,0).Values(0).Value
For which I got the output - 156887-9

Now the problem is when I try to access the 1st row by pass GetCell(1,0) I am always getting -
Exception has been thrown by the target of an invocation.

For your reference the Structure for io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(2,0) is

ResultsTableCell { ColumnIndex=0, DataSource=Automatic, DataVersion=0, IsHeader=false, IsMissing=false, OperatorConfirmed=false, RowIndex=2, Values=ResultsValue[1] { ResultsValue { Components=ResultsDataPoint[0] { }, Confidence=0.99925107, DerivedFields=ResultsDerivedField[0] { }, OcrConfidence=1, OperatorConfirmed=false, Reference=ResultsContentReference { TextLength=11, TextStartIndex=1077, Tokens=ResultsValueTokens[1] { ResultsValueTokens { Boxes=Box[1] { T:306.1333,L:31.4667,W:41.6,H:8.2667 }, Page=0, PageHeight=792, PageWidth=612, TextLength=11, TextStartIndex=1077 } } }, TextType=Text, UnformattedValue=“156887-9”, Value=“156887-9” } } }

and the structure for
io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(1,0) is

ResultsTableCell { ColumnIndex=0, DataSource=Automatic, DataVersion=0, IsHeader=false, IsMissing=true, OperatorConfirmed=false, RowIndex=1, Values=null }

My usecase is I want to copy the value I obtained from GetCell(2,0) to the reference in GetCell(1,0) so as when the data goes to Validation station from human confirmation the values in (1,0) and (2,0) row and column index appear to be same.

Thanks!

from the sample we can interpret Row1 value is null

for the transfer we recommend:

  • create a new DataPoint (maybe you can Copy it from the row 2 - but use the Copy Method, otherwise it has the risk of placing it as reference)
  • set the DataPoint on Row1

Can you please help with that.

How can I achieve that!!

in other words:

Bring the ResultValue from row2 to row 1.

is it more clear?

Yeah I got that.

But how to bring it like result value from row 2 to row 1 I am not getting on that point.

Can you please help on that!

Can you try?

io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(1,0).Values =
io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(2,0).Values.Copy()

Hi @ppr

I tried this the schema is getting copied and so the value but when validation station is up still value is not visible. See below column Style row 1 is still empty where the value was copied.
Can you suggest.

image

we cannot fully replicate at our end.

Please type in within the immediate panel:

io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(2,0).Values.Copy()
io_ExtractionResults.ResultsDocument.Tables(0).Values(0).GetCell(2,0).Values.GetType

new ResultsValue() - maybe use the full Qualifier of the ResultValue