|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +title: ParsedResultItem - Dynamsoft Code Parser JavaScript Interface |
| 4 | +description: This page shows the ParsedResultItem interface of Dynamsoft Code Parser for JavaScript. |
| 5 | +keywords: ParsedResultItem, javascript, interface |
| 6 | +needAutoGenerateSidebar: false |
| 7 | +noTitleIndex: true |
| 8 | +breadcrumbText: ParsedResultItem |
| 9 | +--- |
| 10 | + |
| 11 | +# ParsedResultItem |
| 12 | + |
| 13 | +The ParsedResultItem interface provides a structure representing the result items returned by Dynamsoft Code Parser. |
| 14 | + |
| 15 | +```ts |
| 16 | +interface ParsedResultItem extends Core.CapturedResultItem { |
| 17 | + codeType: string; |
| 18 | + jsonString: string; |
| 19 | + getFieldValue: (fieldName: string) => string; |
| 20 | + getFieldMappingStatus: (fieldName: string) => EnumMappingStatus; |
| 21 | + getFieldValidationStatus: (fieldName: string) => EnumValidationStatus; |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +<!-- | API Name | Description | |
| 26 | +| ------------------------------------------------------- | ----------------------------------------------------------------------- | |
| 27 | +| [codeType](#codetype) | Returns the code type of the parsed result. | |
| 28 | +| [jsonString](#jsonstring) | Returns the parsed result as a JSON formatted string. | |
| 29 | +| [getFieldValue()](#getfieldvalue) | Gets the value of a specified field from the parsed result. | |
| 30 | +| [getFieldMappingStatus()](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. | |
| 31 | +| [getFieldValidationStatus()](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. | --> |
| 32 | + |
| 33 | +## codeType |
| 34 | + |
| 35 | +Returns the code type of the parsed result. |
| 36 | + |
| 37 | +```ts |
| 38 | +codeType: string; |
| 39 | +``` |
| 40 | + |
| 41 | +## jsonString |
| 42 | + |
| 43 | +Returns the parsed result as a JSON formatted string. |
| 44 | + |
| 45 | +```ts |
| 46 | +jsonString: string; |
| 47 | +``` |
| 48 | + |
| 49 | +## getFieldValue |
| 50 | + |
| 51 | +Gets the value of a specified field from the parsed result. |
| 52 | + |
| 53 | +```ts |
| 54 | +getFieldValue(fieldName: string): string; |
| 55 | +``` |
| 56 | + |
| 57 | +**Parameters** |
| 58 | + |
| 59 | +`fieldName`: specifies the name of the field. |
| 60 | + |
| 61 | +**Return Value** |
| 62 | + |
| 63 | +A string which contains the field value. |
| 64 | + |
| 65 | +**Code Snippet** |
| 66 | + |
| 67 | +```js |
| 68 | +parser.getFieldValue("passportNumber"); |
| 69 | +``` |
| 70 | + |
| 71 | +## getFieldMappingStatus |
| 72 | + |
| 73 | +Gets the mapping status of a specified field from the parsed result. |
| 74 | + |
| 75 | +```ts |
| 76 | +getFieldMappingStatus: (fieldName: string) => EnumMappingStatus; |
| 77 | +``` |
| 78 | + |
| 79 | +**Parameters** |
| 80 | + |
| 81 | +`fieldName`: specifies the name of the field. |
| 82 | + |
| 83 | +**Return Value** |
| 84 | + |
| 85 | +A value that indicates whether the mapping succeeded. |
| 86 | + |
| 87 | +**Code Snippet** |
| 88 | + |
| 89 | +```js |
| 90 | +await parser.getFieldMappingStatus("nationality"); |
| 91 | +``` |
| 92 | + |
| 93 | +**See Also** |
| 94 | + |
| 95 | +* [EnumMappingStatus](../enum/EnumMappingStatus.md) |
| 96 | + |
| 97 | +## getFieldValidationStatus |
| 98 | + |
| 99 | +Gets the validation status of a specified field from the parsed result. |
| 100 | + |
| 101 | +```ts |
| 102 | +getFieldValidationStatus: (fieldName: string) => EnumValidationStatus; |
| 103 | +``` |
| 104 | + |
| 105 | +**Parameters** |
| 106 | + |
| 107 | +`fieldName`: specifies the name of the field. |
| 108 | + |
| 109 | +**Return Value** |
| 110 | + |
| 111 | +A value that indicates whether the validation succeeded. |
| 112 | + |
| 113 | +**Code Snippet** |
| 114 | + |
| 115 | +```js |
| 116 | +await parser.getFieldValidationStatus("passportNumber"); |
| 117 | +``` |
| 118 | + |
| 119 | +**See Also** |
| 120 | + |
| 121 | +* [EnumValidationStatus](../enum/EnumValidationStatus.md) |
0 commit comments