How to get table value from AnalyzeResult

Meekou 1 Reputation point
2022-04-26T07:53:45.753+00:00

I am trying Azure Form Recognizer and its model show correctly.

Then, I try to access my labled value from .net core application.

I have a demo code like below:

using var stream = new FileStream(filePath, FileMode.Open);  
            var operation = await analyseClient.StartAnalyzeDocumentAsync(modelId, stream);  
            await operation.WaitForCompletionAsync();  
            var result = operation.Value;  
            foreach (AnalyzedDocument document in result.Documents)  
            {  
                Console.WriteLine($"Document of type: {document.DocType}");  
  
                foreach (KeyValuePair<string, DocumentField> fieldKvp in document.Fields)  
                {  
                    string fieldName = fieldKvp.Key;  
                    DocumentField field = fieldKvp.Value;  
  
                    Console.WriteLine($"Field '{fieldName}': ");  
  
                    Console.WriteLine($"  Content: '{field.Content}'");  
                    Console.WriteLine($"  Confidence: '{field.Confidence}'");  
                }  
            }  

I am able to get normal fields with above code.

But for labled table, I can only get filed name, I could not get the value for table.

How to get the table value?

196453-image.png

Azure AI Document Intelligence
{count} votes

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,836 Reputation points
    2022-04-29T15:38:16.82+00:00
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.