How to get give an error if any fields are missing in Pdf data extraction?

We are extracting data from PDF file using Document Understanding. We want to get an error if required fields are missing. Kindly show me solution

thanks and regards

Are you using the Document Understanding Framework?

I am using DU

Hi @raju_alakuntla

You can simply check if required fields are null or nothing then use throw error activity.

In this manner.

ReqField1 is nothing and ReqField2 is nothing and ReqField3 is nothing and so on.

And use throw activity if the above condition is passed.


First we can validate with VALIDATION STATION to check with the data

Document Understanding - Data Extraction Validation Overview


If you want to have it inside the workflow then we can use a simple workflow using IF activity

If valudation pass or fail it goes to corresponding then or else part where use THROW activity and mention the excpetion as
New BusinessRuleException(“your exception message”)

Cheers @raju_alakuntla

Hi @raju_alakuntla ,

We can use the Extraction Results from the Data Extraction Scope to Check if there are any Data Missing.

First, Since you need to Check only some fields are Required, we can use a String Array variable, and assign all the field name values to it like below :

requiredFields = {"Name","Address","ID"}

requiredFields variable is an Array of String Type.

Next, we assume extractionResults variable is the Output of Data Extraction Scope. Then Check if the Required Fields are missing in the below way :

extractionResults.ResultsDocument.Fields.Where(Function(x)requiredFields.Contains(x.FieldName.ToString) AndAlso x.IsMissing).Any

The Above results in a True, if any one of the Required Fields is missing a Value.

Here, we need to Note that the Field Names are according to the Taxonomy Manager