Some setup for my question, basically I have a Document Understanding workflow where one of the Document Types has a field with an Address Type, so while the data is extracted the address is also separated into its respective fields (Address Line 1, Address Line 2, City, etc.), and I would like to take those separated values and either assign them to their own variables or place them into the a DataTable.
The problem I am having is I am a newcomer to the world of programming and with limited knowledge on VB I cannot figure out how to isolate these values. The only forum post I’ve found relating to this subject (How to view all invoice properties without opening Validation Station) pushed me in the right direction I believe, but going from there I haven’t found any clues besides learning that the separated fields are referenced as ResultsDerivedFields as opposed to ResultsDataPoints. I’ve tried replacing ResultsDataPoint in “extractionResults.ResultsDocument.Fields.First(Function(i As ResultsDataPoint) i.FieldName = “City”).Values(0).Value” with ResultsDerived Fields but as expected that did not work, so I would love any pointers or help in retrieving those values isolated.
To “read” the DerivedParts of an Address or Name field, you can use the ExportExtractionResults activity and look at every SECOND tab. That contains the “- Formatted” version of the same raw values found in the main values tabs.
Example: I have a field called “Home Address”, and a table called “Furniture”, and the Furniture table contains a column called “Item” and another one called “Shop Address”. If you use the Export Extraction Results activity, you will get a DataSet (Collection of DataTables - which can be accessed using myDataSet.Tables), that contain:
one DataTable called “Simple Fields”, that will contain two columns: “Home Address” and “Furniture”, and one row, with values let’s say “1234 Hickory Hollow Ln, Raleigh, NC 27610” and - if the Furniture table has values, the string “table” (if it doesn’t have any values, it will empty).
one DataTable called “Simple Fields - Formatted”, that will contain the same two columns, but the value for the first cell (the address) will be in the format of a CSV. Like this:
“Key,Value
““Address Line 1"”,”“1234 Hickory Hollon Ln””
““City””,““Raleigh””
““Country””,““United States””
““State / County / Province””,““North Carolina””
““Zip Postal Code””,““27610"””
Now you can parse the CSV in this string and obtain a list of key value pairs, each pertaining to the pieces of the address.
one DataTable called “Furniture”, that will contain two columns in our use case (Item and Shop Addrss), and as many rows as necessary to capture the values. Let’s take one row saying “Chairs” and “123 High St, Suite 12, New York, NY 11223”.
one Datatable called “Furniture - Formatted”, that will contain the same two columns, and the first row values being “Chairs” and the associated CSV delimited address parts, as
“Key,Value
““Address Line 1"”,”“123 High St””
““Address Line 2"”, ““Suite 12"”
““City””,”“New York””
““Country””,““United States””
““State / County / Province””,““New York””
““Zip Postal Code””,““11223"””.