Emailed Receipts Service
Last updated
Last updated
This machine workflow reads new messages in the unified inbox for receipts.
The workflow will fetch all messages that are unread in the inbox defined in Flow Property “ExpenseInboxAddress."
The from address will be validated against the list of valid domains defined in the Flow Property “ExpenseDomains." Messages that do not match any of the domains will be deleted. The following are examples of these parameters:
Azure Storage Services will be used to store the message information and the receipt files. The Blob Storage will be used for storing the receipt files. The workflow will check that a Blob Storage Container has been set up and if it is not, a new container will be created with the name defined in the Flow Property “ExpenseBlobContainerName”.
The Table Storage will be used for the message metadata and will be the input for the emailed receipt inbox. The workflow will check if the table has been created and if not, it will create the table defined in the Flow Property “ExpenseTableName”.
For new records in the table a partition key is needed, and it will be set in the Flow Property “ExpenseTablePartitionKey”. The following are examples of these parameters.
After the workflow has been run for the first time, the storage will be initialized with a new container and a new table.
All attachments for a message will be fetched and depending on the setting in the Flow Property “ExpenseInlineAttachments”, the attachments that are inline will be filtered out or not. The following is an example of this parameter:
Next the file format will be checked against the supported file extensions for images in the IFS Media Library. If the file format isn’t supported, the user will be notified by email.
If there are no attachments for a message, the user will also be notified by email. Attachments will be stored in the Blob Storage in a folder with the same name as the message ID and the in a sub folder with the attachment ID.
The receipt will be sent to Microsoft Form Recognizer Cognitive Service for analyze and if it succeeds a merchant, transaction date and a total amount will be returned to the workflow.
After the analyze is done, the message metadata will be stored as a new record in the table storage.
The workflow should be scheduled to be run in a reoccurring interval e.g., every five minutes. Right click on the workflow and select Schedule.
Click Enable and select a machine user, set the interval and leave the End date empty, then Save.
If an error occurs in the service workflow the error message will be sent by email to the address(es) defined in the Flow Property “ExpenseAdmin”. Multiple email addresses should be added as a comma separated list.