UiPath Documentation
activities
latest
false
Atividades do Document Understanding
Importante :
A tradução automática foi aplicada parcialmente neste conteúdo. A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.

ExtractionResultHandler Class

ExtractionResultHandler entry point of the V1 navigator, with the constructor, factory and conversion methods, and the field navigation members it inherits.

Definição

  • Espaço de nomes: UiPath.DocumentProcessing.Contracts.Extensions.Navigator.V1
  • Montagem: UiPath.DocumentProcessing.Contracts
  • Inherits: ComponentCollectionFacade

Description

ExtractionResultHandler is the entry point of the V1 navigator. It provides a fluent, strongly-typed way to navigate and edit the fields of an ExtractionResult without manually casting raw ResultsDataPoint and ResultsValue objects.

A handler is created from an ExtractionResult and wraps the field collection at ExtractionResult.ResultsDocument.Fields. The inherited navigation methods then reach each field as a typed facade:

Because the handler inherits from ComponentCollectionFacade, the navigation methods listed under Inherited members are available directly on the handler.

Membros

Construtores

ConstrutorDescription
ExtractionResultHandler(ExtractionResult extractionResult)Initializes a new navigator over the fields of the specified extraction result (ResultsDocument.Fields).

Factory and conversion methods

All methods in this section are static.

MétodoRetornaDescription
FromExtractionResult(ExtractionResult extractionResult)ExtractionResultHandlerCreates a navigator from an extraction result.
FromTable(ResultsDataPoint tableDataPoint)TableDataPointWraps a table data point in a table facade.
FromFieldGroup(ResultsDataPoint fieldGroupDataPoint)FieldGroupDataPointWraps a field group data point in a field group facade.
FromBasicDataPoint(ResultsDataPoint basicDataPoint)BasicDataPointWraps a basic data point in a basic field facade.
FromDataPoint(ResultsDataPoint dataPoint)WildcardDataPointWraps any data point in a wildcard facade.
FromFieldGroupValue(ResultsValue resultsValue)FieldGroupValueWraps a field group value in a field group value facade.
FromTableValue(ResultsValue tableValue)TableValueWraps a table value in a table value facade.
FromTableRow(ResultsValue tableRow)TableRowWraps a table row value in a table row facade.
FromBasicValue(ResultsValue basicValue)BasicValueWraps a basic value in a basic value facade.

Inherited members

The following methods are inherited from ComponentCollectionFacade and are available directly on ExtractionResultHandler. The fieldLookup and tableLookup parameters follow the field lookup resolution rules in FieldLookupBase.

MétodoRetornaDescription
GetFields(Func<ResultsDataPoint, bool> condition = null, bool recursive = false)WildcardDataPointCollectionReturns the fields matching condition, or all fields when condition is null. When recursive is true, nested fields are included.
GetSimpleFields()BasicDataPoint[]Returns all basic (non-complex) fields.
GetSimpleField(string fieldLookup)BasicDataPointReturns the basic field matching the lookup.
GetTables()TableDataPoint[]Returns all table fields.
GetTable(string tableLookup)TableDataPointReturns the table field matching the lookup.
GetTableValue(string tableLookup)TableValueReturns the value of the table field matching the lookup.
GetFieldGroups()FieldGroupDataPoint[]Returns all field group fields.
GetFieldGroup(string fieldLookup)FieldGroupDataPointReturns the field group field matching the lookup.
GetFieldGroupValue(string fieldLookup, int index)FieldGroupValueReturns the field group instance at index for the field matching the lookup.

Exemplos

When the Generate Data Type property of the Extract Document Data activity is off, you can obtain a handler directly from the activity output through the Handler property: var handler = DocumentData.Data.Handler;.

The following example creates a handler from an ExtractionResult and uses the navigation methods to read date values, a field group instance, and one of its child fields.

using UiPath.DocumentProcessing.Contracts.Taxonomy;
using UiPath.DocumentProcessing.Contracts.Extensions.Navigator.V1;

// Create a navigator over the fields of an extraction result.
var handler = new ExtractionResultHandler(extractionResult);

// Get all date values across the document (recursive to include nested fields).
foreach (var dateField in handler.GetFields(dp => dp.FieldType == FieldType.Date, recursive: true).BasicFields)
{
    foreach (var dateValue in dateField.Values)
    {
        Console.WriteLine($"{dateField.FieldName}: {dateValue.Value}");
    }
}

// Get the 3rd instance of the "ShippingDetails" field group (index is zero-based).
var shippingInstance = handler.GetFieldGroupValue("ShippingDetails", 2);

// From that instance, read a child field value.
var city = shippingInstance.GetSimpleField("City");
string cityText = city?.Value?.Value;
using UiPath.DocumentProcessing.Contracts.Taxonomy;
using UiPath.DocumentProcessing.Contracts.Extensions.Navigator.V1;

// Create a navigator over the fields of an extraction result.
var handler = new ExtractionResultHandler(extractionResult);

// Get all date values across the document (recursive to include nested fields).
foreach (var dateField in handler.GetFields(dp => dp.FieldType == FieldType.Date, recursive: true).BasicFields)
{
    foreach (var dateValue in dateField.Values)
    {
        Console.WriteLine($"{dateField.FieldName}: {dateValue.Value}");
    }
}

// Get the 3rd instance of the "ShippingDetails" field group (index is zero-based).
var shippingInstance = handler.GetFieldGroupValue("ShippingDetails", 2);

// From that instance, read a child field value.
var city = shippingInstance.GetSimpleField("City");
string cityText = city?.Value?.Value;
  • Definição
  • Description
  • Membros
  • Construtores
  • Factory and conversion methods
  • Inherited members
  • Exemplos

Esta página foi útil?

Conectar

Precisa de ajuda? Suporte

Quer aprender? Academia UiPath

Tem perguntas? Fórum do UiPath

Fique por dentro das novidades