Task Image - Scan Document (Cloud)
The Scan document (cloud) Task sends documents, such as invoices, receipts and business cards, to a cloud document service, and saves the fields that the service finds to Variables, to the Task output or to files.
The Task works with these services, each through its own Connection:
- Microsoft Azure Form Recognizer, through a Microsoft Azure Connection whose Connection type is "Form Recognizer"
- Google Document AI, through a Google Document AI Connection with the endpoint of a processor and a JSON key file
You need an account with one of these services to use this Task.
The Main settings, Flow, On error, Conditions and TimeOut tabs are the same for every Task; see Job - Tasks.
How it works
- The File filter finds the files to process.
- For each file, the Server uploads the file to the service of the selected Connection.
- The service extracts the fields and returns them.
- The Task saves the field values to Variables, to the Task output or to files, as set for each field.
Setting up Cloud services
Azure
In the Microsoft Azure portal search for "Form Recognizer"

Click on “Form Recognizer” and create new Form Recognizer Service. After creating Form Recognizer Service, select it from your Azure Dashboard and then select “Keys and Endpoint”:

Here you can find key and endpoint for creating new Visual Cron connection. Now in Visual Cron you can create new connection of type “Microsoft Azure”. In Microsoft Azure connection form select Connection type as “Form Recognizer”:

In Authentication tab you can paste your Endpoint and Key:

Then specify Name of connection and click OK. Now this connection is ready to be used in Scan Document (cloud) Task.
Google
First in Google Cloud Platform search for “Document AI” and click on it:

Then create a new processor:

Then in Document AI dashboard you can select existing processor and copy endpoint from there:

After that you should create Google Service Account. Details on how to do that can be found here https://cloud.google.com/iam/docs/creating-managing-service-accounts.
Then in KEYS tab of your service account you should create a new json key:


After that the json key should be downloaded to your PC. And now you can use endpoint and json key to create new VisualCron connection.

Task settings
File filter tab
The Task uses the File filter to find the files to process. It processes every file that the filter finds.
Scan properties tab
In the Scan properties tab you select the service and the document type, and set up the fields from a sample document.
- Provider Connection: the Connection of the service to use. Connections are set up in Connections
- Document type: the type of document to scan. Shown only for an Azure Form Recognizer Connection: "Invoice", "Receipt" or "Business card". For a Google Document AI Connection, the processor of the Connection decides what is extracted
- Scan: open a sample document in the document viewer, then click Scan. The Client sends the sample document to the service and lists the fields that it finds in Fields/Variables
- Fields/Variables: the fields found in the sample document. Each row becomes a Variable, named after the field, when the Task runs
Variable output settings is collapsed by default. Expand it to set how the selected field is saved:
- Field separator, Text qualifier and Line break: the format of the value
- Output to Task Variable: adds the value to the Task result, as a Variable named after the field
- Output to Job Variable: sets a Job Variable with the name of the field. When a user runs the Job, the user needs permission to edit the Variables of the Job, or the Task fails
- Output to file: writes the value to the file in File output settings
File output settings:
- The Credential to use when writing the file
- File path: the full path and file name of the output file. Accepts Variables
- Include BOM (if UTF8): writes a byte order mark when the Task writes UTF-8
- Append to file: adds the value to the end of the file instead of replacing it
Output tab
The Task window has an extra Output tab for this Task. Its Output settings control the output of all fields together:
- Include field names: writes a first line with the column names,
Name,ValueandConfidence, for each file - Field separator, Text qualifier and Line break: format each line
- Output to standard output: writes one line for each field, with its name, value and confidence as a percentage, to the Task output
- Output to file: writes the same lines to the file in its File output settings
When Append to file is unchecked, the Task replaces the output file each time it writes it. When the File filter finds several files, the Task writes the file once for each file, each time with the lines of all files processed so far; with Append to file checked, the lines of each earlier file are therefore written again with each later file.
Output and errors
When the File filter finds no file, the Task fails with a file-not-found error. To change how the Task responds to errors, see Task - On error.
When the service does not return a field that is in Fields/Variables, the Task skips that field: its Variable is not set and nothing is written for it, and the Task reports success.