[BUG] Azure Form Recognizer Prebuilt Business Card Template code.
See original GitHub issueLibrary name and version
Azure Form Recognizer (2022-08-31) (GA)
Describe the bug
Template Prebuilt Business Card operations with the Azure Form Recognizer client library code a bug AsList() , AsDictionary() , AsString()
example
ContactNamesField.AsList() contactNameField.AsDictionary(); firstNameField.AsString();
foreach (DocumentField contactNameField in **ContactNamesField.AsList()**)
if (contactNameField.**ValueType** == DocumentFieldType.Dictionary)
{
IReadOnlyDictionary<string, DocumentField> contactNameFields = **contactNameField.AsDictionary();**
if (contactNameFields.TryGetValue("FirstName", out DocumentField firstNameField))
{
if (firstNameField.ValueType == DocumentFieldType.String)
{
string firstName **= firstNameField.AsString();**
Expected behavior
Template Prebuilt Business Card operations with the Azure Form Recognizer client library code must be changed as
AsList() , AsDictionary() , AsString() convert from Value field.
ContactNamesField.Value.AsList() contactNameField.Value.AsDictionary() firstNameField.Value.AsString()
foreach (DocumentField contactNameField in **ContactNamesField.Value.AsList()**)
{
Console.WriteLine("Contact Name: ");
if (contactNameField.FieldType == DocumentFieldType.Dictionary)
{
IReadOnlyDictionary<string, DocumentField> contactNameFields = **contactNameField.Value.AsDictionary()**;
if (contactNameFields.TryGetValue("FirstName", out DocumentField firstNameField))
{
if (firstNameField.FieldType == DocumentFieldType.String)
{
string firstName = **firstNameField.Value.AsString()**;
}
}
Actual behavior
https://formrecognizer.appliedai.azure.com/studio/prebuilt?formType=businessCard
Reproduction Steps
https://formrecognizer.appliedai.azure.com/studio/prebuilt?formType=businessCard
Refer Code area and select C#
Environment
https://formrecognizer.appliedai.azure.com/studio/prebuilt?formType=businessCard
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
@rvinothrajendran @adreno-abhi The samples in Form Recognizer Studio have been fixed. Feel free to update this issue if you think we missed anything.
Thank you for your feedback. Tagging and routing to the team member best able to assist.