Create app task for Validation station using Document understanding outputs

Hi! I wonder how to join Document Understanding feature with Validation station. I see in the examples that for Validation station you need to create App task. But when using Document Understanding feature, we create Validation task.

My point is that we rely on Document Understanding engine of UiPath and want to use Validation station in the custom UiPath web app (in actions center). However, Document Understanding activities provide outputs for Validation task, not for App task (which we need for Validation station).

Could someone help with that? Any sample flow with running Document understanding extractor and then creating App task?

@verifyexecution I’m not pretty sure about your requirements but in case if you want to use document understanding with Action Centre. Please use below workflow while developing process in Document Understanding Process Template

If its not you are looking for pls elaborate the requirement more

Hi @verifyexecution refer below link for validation app task

https://t8454543.p.clickup-attachments.com/t8454543/86f95d49-730b-4491-ba3e-8a846ed286e5/Public%20Preview%20Starter%20Kit%20v1.zip?view=open

Thank you for responses. I’ll clarify my question a bit.

Main-ActionCenter.xaml shared above uses Document understanding and Validation task. It creates validation tasks and they appear in the default Actions interface.

Preview-kit shared above uses machine learning and OCR (not models trained in Document understanding) and App task for Validation Center. It creates app tasks and they appear in your custom UiPath app.

The problem is - how I can still use Document understanding (like in Main-ActionCenter.xaml) and create App tasks for Validation center which is integrated in my custom app since I need a custom interface for validating documents.

Example:
Data type required by App task: Activities - ContentValidationData Class
Data type output from Document understanding extractor: DataExtraction.IDocumentData

The question is how to convert output from Document understanding extractor (part of IntelligentOCR.ExtractDocumentDataWithDocumentData activity) to input for App task - so I can see a parsed document in my app.

The idea is to map fields of IDocumentData<DictionaryData> (from IntelligentOCR namespace) to ContentValidationData (from DocumentProcessing space).

This is just a sample generated by LLM with wrong fields of IDocumentData. If you have a specification of the IDocumentData class please share it.

using System;
using System.Collections.Generic;
using System.IO;
using UiPath.IntelligentOCR.StudioWeb.Activities.DataExtraction;
using UiPath.DocumentProcessing.Contracts.Actions;
using UiPath.DocumentProcessing.Contracts.Results;
using UiPath.DocumentProcessing.Contracts.Dom;

public static class DocumentDataToValidationDataConverter
{
    public static ContentValidationData Convert(IDocumentData<DictionaryData> documentData)
    {
        if (documentData == null) throw new ArgumentNullException(nameof(documentData));

        var extractionResult = BuildExtractionResult(documentData);
        var document = BuildDocument(documentData);
        var taxonomyPath = GeneratePath("taxonomy.json");

        return new ContentValidationData
        {
            DocumentId = extractionResult.DocumentId,
            OriginalDocumentFileName = document.DocumentID,
            AutomaticExtractionResultsPath = GeneratePath("auto_results.json"),
            ValidatedExtractionResultsPath = GeneratePath("validated_results.json"),
            DocumentObjectModelPath = GeneratePath("document_model.json"),
            ExtractorPayloadsPath = GeneratePath("extractor_payloads.json"),
            TextPath = GeneratePath("document_text.txt"),
            TaxonomyPath = taxonomyPath,
            BucketId = "default-bucket-id",
            BucketName = "default-bucket",
            FolderId = Guid.NewGuid().ToString(),
            FolderKey = Guid.NewGuid().ToString(),
            DocumentPath = GeneratePath(document.DocumentID),
            EncodedDocumentPath = GeneratePath("encoded_document.pdf"),
            CustomizationInfoPath = GeneratePath("customization.json"),
            AdditionalDataPath = GeneratePath("additional/"),
            ShowOnlyRelevantPageRange = true
        };
    }

    private static ExtractionResult BuildExtractionResult(IDocumentData<DictionaryData> documentData)
    {
        var extractionResult = new ExtractionResult
        {
            DocumentId = documentData.DocumentId,
            ExtractorPayloads = documentData.ExtractedData?.Payload,
            ResultsVersion = 0,
            ResultsDocument = documentData.ExtractedData?.ToResultsDocument() ?? new ResultsDocument()
        };

        return extractionResult;
    }

    private static Document BuildDocument(IDocumentData<DictionaryData> documentData)
    {
        return new Document
        {
            ContentType = "application/pdf",
            DocumentID = documentData.DocumentId,
            DocumentMetadata = new List<Metadata>(),
            Length = documentData.Text?.Length ?? 0,
            Pages = new Page() // Populate as needed
        };
    }

    private static string GeneratePath(string fileName)
    {
        return Path.Combine("validation-data", Guid.NewGuid().ToString(), fileName);
    }
}