Extract data from data extraction result

HI all,

I try to extract the retrieved data from the variable: UiPath.Intelligent OCR.StudioWeb.Activities.DataExtraction.DocumentData<UiPath.Intelligent OCR.StudioWeb.Activities.DataExtraction.DictionaryData>

It is an IDocumentData variable and i would like to get the results in a datatable or something to work with.
I get the values from the extract Document data step.

Thank you in advance!

Hello, welcome to the community.

In the cross platform activities you are using it should actually generate a specific document type, based on the extractor that you use, which means you dont need to mess around with that dictionary thing, each field will get a specific property.

Can you share some screenshots and we can guide you abit more.

Hi Jon,

thank you for the quick response. see the printscreen below;

i want to assign them into specific variables that I have yet to create.

Ok nice. Toggle that ‘Generate Data Type’ to on.
Then recreate the variables for the Document Data output variable again using ctrl+k so it grabs the new data type that was made.

Once you get that data type you’ll have a property on the out_DocumentData called .Data

and on that property you’ll be able to see your fields of Clientgegevens, Clientnaam etc and be able to work with each.

Hi Jon,

I got the .data working, but still working on how te get the specific data out of the dictionarydata variable. got any suggestions?

Hi @jeffrey.wagensveld1

Use YourDocData.Data(“FieldName”).Text to get the value. Replace FieldName with the actual key.
Happy Automation

Hi,

When i use the docdata.data in the watch panel, it looks like my dictionary is empty: DictionaryData { }
so i get an error when i try to get a specific value.
when i look at my docdata variable as a whole in the watchpanel i see this:
[
Clientgegevens Table data:
Clientnaam
J Wagensveld

Documenttype Table data:
Documenttype
Algemeen – test
]
any suggestions?

Ok @jeffrey.wagensveld1

I think Your data is stored in DocData.Tables, not in docData.Data … That’s why the dictionary appears empty.

Try like this:
docData.Tables(“Clientgegevens”).Fields(“Clientnaam”).Value.Text
docData.Tables(“Documenttype”).Fields(“Documenttype”).Value.Text

solved it with:
Docdata.Data.GetFieldValue(“Clientgegevens”).Components.
Where(Function(c) c.FieldId = “Clientgegevens.Body”).First().
Values(0).Components.
Where(Function(dp) dp.FieldId = “Clientnaam”).First().
Values(0).Value.ToString

You dont need to use this GetFieldValue stuff.

It should just work with Docdata.Data.Clientgegevens if you toggle on that generate data types thing I said.

Its nasty working with dictionaries, you are far better off using strong data typing.

1 Like

i tried, but it says:

Did you follow my instructions to toggle that option on, and then remake the variable? It appears you did not, and as such you still have the data dictionary.

Hi Jon,

I actually did. I removed the whole variable, toggled the generate data type on and remade the variable with cntrl + K but it keeps coming up as the same variable..


If you want you can even look with me in a session.

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