|
Purpose Using a Microsoft Azure web service, an image of an expense receipt is automatically processed and the data is read.
Example |
|
Solution In this example, we use the service from Microsoft: Azure Form Recognize. "The AI-powered document extraction service that understands your forms." This service can be called via REST API. We can do this in GuiXT either with callJS or with an embedded HTML page in which we call a corresponding JavaScript function. We use the 2nd way here for the following reason: We want to give the interface a local file directly. For security reasons we need to use an input element on the HTML page so that the user can select a file. JavaScript cannot automatically access the local file system. |
|
Requirements Microsoft Azure Form Recognizer is a service that is free with moderate usage. However, you need to initiate this service yourself in the Azure Portal to get an API key. You can find more information directly at Microsoft e.g. at Azure Form Recognizer |
|
Implementation GuiXT Script "sapmp56t.e1350.txt" (we extend transaction PR05 - Travel Expense Manager) GuiXT The HTML file "azure_test.html" We only need an INPUT element that starts the process: HTML |
It is important to define this function in the embedded HTML file and use the GuiXT keyword
"connnectHTML"
so the GuiXT JavaScript object is available in the following functions. We use this object
to change GuiXT variables and call InputScripts via JavaScript.
JavaScript
JavaScript Function "analyzeDocument()"
JavaScript
JavaScript Function "getResult()"
JavaScript
Components
InputAssistant + Controls