Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. A Classify Node is used to find text elements that would be reflective of a vendor.  In this case, we will be scanning invoices for a web address using a simple regular expression pattern.
  2. A check is perform made to make sure ensure data was collected from the document that matches the extraction rule, in this case some form of a URL.
  3. A Custom Node is leveraged to pass a URL extracted from the invoice to the Places API.  This API from Google allows you to lookup a Company Name based on phone number, or as in this case, web address.  The node is intentionally generic and can make requests into any endpoint that will accept GET requests.  The Node makes the request, receives a JSON response, and parses the response data into matching fields of the workflow.  The C# source for the node can be found here.  Specific to this example, if an API Key is provided to the Places API as a parameter of the URL, no authentication is required.  The Get JSON node's User and Password fields are left blank in this example.

    Code Block
    languagejs
    titleSample JSON Response from Places API
    {
       "candidates" : [
          {
             "formatted_address" : "127 Church St, New Haven, CT 06510, USA",
             "name" : "Square 9 Softworks"
          }
       ],
       "status" : "OK"
    }


  4. Check the field of interest to ensure data was returned.
  5. Copy the data from the generic field of the Places API "name", to a user friendly equivalent "Vendor Name".  If the Node we authored with a specific intention in mind, this step could be avoided.
  6. In case of exceptions or missing data, send the document to a validation queue for manual intervention.