Skip to content
Report an issue

Documents

DocumentsService

Service for managing UiPath DocumentUnderstanding Document Operations.

This service provides methods to extract data from documents using UiPath's Document Understanding capabilities.

create_validation_action

create_validation_action(
    action_title,
    action_priority,
    action_catalog,
    action_folder,
    storage_bucket_name,
    storage_bucket_directory_path,
    extraction_response,
)

Create a validation action for a document based on the extraction response. More details about validation actions can be found in the official documentation.

Parameters:

Name Type Description Default
action_title str

Title of the action.

required
action_priority ActionPriority

Priority of the action.

required
action_catalog str

Catalog of the action.

required
action_folder str

Folder of the action.

required
storage_bucket_name str

Name of the storage bucket.

required
storage_bucket_directory_path str

Directory path in the storage bucket.

required
extraction_response ExtractionResponse

The extraction result to be validated, typically obtained from the extract method.

required

Returns:

Name Type Description
ValidationAction ValidationAction

The created validation action.

Examples:

validation_action = service.create_validation_action(
    action_title="Test Validation Action",
    action_priority=ActionPriority.MEDIUM,
    action_catalog="default_du_actions",
    action_folder="Shared",
    storage_bucket_name="TestBucket",
    storage_bucket_directory_path="TestDirectory",
    extraction_response=extraction_response,
)

create_validation_action_async async

create_validation_action_async(
    action_title,
    action_priority,
    action_catalog,
    action_folder,
    storage_bucket_name,
    storage_bucket_directory_path,
    extraction_response,
)

Asynchronously create a validation action for a document based on the extraction response.

extract

extract(project_name, tag, file=None, file_path=None)

Extract predicted data from a document using an IXP project.

Parameters:

Name Type Description Default
project_name str

Name of the IXP project. Details about IXP projects can be found in the official documentation.

required
tag str

Tag of the published project version.

required
file FileContent

The document file to be processed.

None
file_path str

Path to the document file to be processed.

None
Note

Either file or file_path must be provided, but not both.

Returns:

Name Type Description
ExtractionResponse ExtractionResponse

The extraction result containing predicted data.

Examples:

with open("path/to/document.pdf", "rb") as file:
    extraction_response = service.extract(
        project_name="MyProject",
        tag="live",
        file=file,
    )

extract_async async

extract_async(project_name, tag, file=None, file_path=None)

Asynchronously extract predicted data from a document using an IXP project.

get_validation_result

get_validation_result(validation_action)

Get the result of a validation action.

Note

This method will block until the validation action is completed, meaning the user has completed the validation in UiPath Action Center.

Parameters:

Name Type Description Default
validation_action ValidationAction

The validation action to get the result for, typically obtained from the create_validation_action method.

required

Returns:

Name Type Description
ValidatedResult ValidatedResult

The result of the validation action.

Examples:

validated_result = service.get_validation_result(validation_action)

get_validation_result_async async

get_validation_result_async(validation_action)

Asynchronously get the result of a validation action.