{"id":24717,"date":"2020-09-11T15:07:56","date_gmt":"2020-09-11T15:07:56","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=24717"},"modified":"2020-09-11T15:07:56","modified_gmt":"2020-09-11T15:07:56","slug":"how-to-use-receipt-processor-ai-builder-in-canvas-app","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/09\/how-to-use-receipt-processor-ai-builder-in-canvas-app\/","title":{"rendered":"How to use Receipt Processor AI Builder in Canvas App"},"content":{"rendered":"<p style=\"text-align: justify;\">As like with every release, Microsoft brings various new features that help to improve productivity and make the user&#8217;s life easier and faster. So, here we explore one such amazing feature -Receipt Processor (AI Builder).<\/p>\n<p style=\"text-align: justify;\">Before proceeding further, I would like to inform you that to use this feature you need to enable the AI builder. Also, this feature is currently in PREVIEW. Here, we must have AI Builder License enabled to use <strong>Text Recognizer<\/strong> in Canvas App.<\/p>\n<p style=\"text-align: justify;\">Let\u2019s create a scenario to use this feature. Consider a restaurant owner who enters all their receipt data manually in the CRM, this is a tiring and time-consuming process. So, to make the process easier and faster, they can now use the quick and automatic <strong>Receipt Processor<\/strong> feature. All they need to do is scan the receipt and it will automatically fill the data into the CRM without manually typing anything.<\/p>\n<p style=\"text-align: justify;\">To enable this feature, we need to develop a Canvas app with the ability to scan the receipt and fill the data into CRM.<\/p>\n<h2><strong>Steps to use Receipt Processor in Canvas App.<\/strong><\/h2>\n<p><strong>The below steps will help to store the Scanned Receipt details into CRM in one custom entity and attach the scanned receipt image in Notes as an attachment of Receipt record.<\/strong><\/p>\n<ol>\n<li>Navigate to <a href=\"https:\/\/make.powerapps.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/make.powerapps.com\/<\/a><\/li>\n<li>Create a new blank Canvas app and add Receipt Processor control from AI Builder tab as highlighted below.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24728 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-1.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"427\" height=\"230\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-1.png 427w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-1-300x162.png 300w\" sizes=\"(max-width: 427px) 100vw, 427px\" \/><\/a><\/li>\n<li>You will see the below screen of Receipt Processing Control<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24727 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-2.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"547\" height=\"341\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-2.png 547w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-2-300x187.png 300w\" sizes=\"(max-width: 547px) 100vw, 547px\" \/><\/a><\/li>\n<li>The Receipt Processing model will return the output in the following information:<br \/>\n4.1. MerchantName: Name of the merchant i.e. printed on the receipt.<br \/>\n4.2. MerchantAddress: Address printed on the receipt.<br \/>\n4.3. MerchantPhone: Phone Number.<br \/>\n4.4. TransactionDate: Date when transaction is done.<br \/>\n4.5. TransactionTime: Time when transaction is done.<br \/>\n4.6. Subtotal: Subtotal of the bill.<br \/>\n4.7. Tax: Tax.<br \/>\n4.8. Tip: Tip.<br \/>\n4.9. Total: Total amount of bill. Etc.<strong>Note:<\/strong><br \/>\n\u2022 Receipt values are returned as strings.<br \/>\n\u2022 The file size must be less than 20 MB.<br \/>\n\u2022 The image format must be JPEG, PNG, or PDF.<br \/>\n\u2022 The image dimensions must be between 50 x 50 pixels and 10000 x 10000 pixels.<br \/>\n\u2022 PDF dimensions must be at most 17 x 17 inches, which is the equivalent of the Legal or A3 paper sizes or smaller.<\/li>\n<li>Insert the Text Input Controls to show scanned receipt\u2019s data to the user on the page as shown below.<br \/>\n<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24726 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-3.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"223\" height=\"370\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-3.png 223w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-3-181x300.png 181w\" sizes=\"(max-width: 223px) 100vw, 223px\" \/><\/a><\/li>\n<li>Select the textbox and set its Default property using the formula as &#8216;<strong>ReceiptProcessor1.MerchantName&#8217;<\/strong>. This formula will display the name which is printed on the receipt.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-4.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24725 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-4.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"776\" height=\"443\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-4.png 776w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-4-300x171.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-4-768x438.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-4-660x377.png 660w\" sizes=\"(max-width: 776px) 100vw, 776px\" \/><\/a><\/li>\n<li>You can display other details also like Address, Phone number, Total, Sub Total, Tax, etc. as mentioned in point #7.Here, as we said, we are going to store the scanned data into a custom entity, we have used the <strong>Receipt Details<\/strong> entity as shown below. Also, we\u2019re going to attach the Receipt image as a note\u2019s attachment in the CRM.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-5.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24724 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-5.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"745\" height=\"375\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-5.png 745w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-5-300x151.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-5-660x332.png 660w\" sizes=\"(max-width: 745px) 100vw, 745px\" \/><\/a><\/li>\n<li>Add the button as shown in the above screenshot and add formula <strong>onSelect<\/strong> property of the <strong>Submit<\/strong> button to create the record in CRM as shown below.<strong>Formula:<\/strong> Patch(&#8216;Receipt Details&#8217;,Defaults(&#8216;Receipt Details&#8217;),{Name:txtName.Text,Address:txtAddress.Text,&#8217;Phone Number&#8217;:txtPhone.Text,&#8217;Sub Total&#8217;:txtSubTotal.Text,Tax:txtTax.Text,Tip:txtTip.Text,Total:txtTotal.Text,&#8217;Transaction Date&#8217;:dtTransactionDate.SelectedDate});<br \/>\nThe above formula will create the record in the <strong>Receipt Detail<\/strong> custom entity.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-6.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24723 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-6.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"1284\" height=\"94\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-6.png 1284w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-6-300x22.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-6-768x56.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-6-1024x75.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-6-660x48.png 660w\" sizes=\"(max-width: 1284px) 100vw, 1284px\" \/><\/a><\/li>\n<li>To store the scanned receipt in the Note entity as an attachment, you can refer to the below formula which we have added on the same Submit button as shown below:<strong>Formula:<\/strong> Patch(Notes,Defaults(Notes),{Title:txtName.Text,&#8217;Is Document&#8217;:true,Regarding:First(receiptDetailRecord), &#8216;File Name&#8217;: &#8220;receipt.jpg&#8221;, Document:Replace(ReceiptProcessor1.OriginalImage,1,23,&#8221;&#8221;)})<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-7.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24722 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-7.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"1037\" height=\"213\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-7.png 1037w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-7-300x62.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-7-768x158.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-7-1024x210.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-7-660x136.png 660w\" sizes=\"(max-width: 1037px) 100vw, 1037px\" \/><\/a>The above formula will create a Note entity record related to Receipt Detail custom entity record.<strong>Note:<\/strong> To create attachments in CRM we have to pass the document body in base64 string. In the canvas app, the Receipt Processor control gives the data as base64 string of scanned receipt with the prefix \u201cdata:image\/jpeg;base64,\u201d or \u201cdata:image\/png;base64,\u201d. So while creating the annotation record in CRM we have to remove \u201cdata:image\/jpeg;base64,\u201d or \u201cdata:image\/png;base64,\u201d from the data.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-8.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24721 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-8.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"636\" height=\"296\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-8.png 636w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-8-300x140.png 300w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/><\/a>Below is the sample of the Receipt that we can use for scanning the details.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-9.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24720 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-9.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"277\" height=\"398\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-9.png 277w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-9-209x300.png 209w\" sizes=\"(max-width: 277px) 100vw, 277px\" \/><\/a><\/li>\n<li>After adding all the details, save the App and run. Click on the <strong>Scan Receipt<\/strong> button and select the receipt that you want to scan.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-10.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24719 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-10.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"376\" height=\"656\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-10.png 376w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-10-172x300.png 172w\" sizes=\"(max-width: 376px) 100vw, 376px\" \/><\/a><\/li>\n<li>It will fetch all the details of your receipt and print them on labels\/textbox as shown above.<\/li>\n<li>Then click on the Submit button to create the record in CRM as shown below.<\/li>\n<\/ol>\n<h2><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-11.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24729 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-11.png\" alt=\"Receipt Processor AI Builder in Canvas App\" width=\"716\" height=\"469\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-11.png 716w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-11-300x197.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Receipt-Processor-AI-Builder-in-Canvas-App-11-660x432.png 660w\" sizes=\"(max-width: 716px) 100vw, 716px\" \/><\/a><\/h2>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Now we can use <strong>Receipt Processor Control<\/strong> in Canvas app to scan receipts used by restaurants, gas stations, etc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As like with every release, Microsoft brings various new features that help to improve productivity and make the user&#8217;s life easier and faster. So, here we explore one such amazing feature -Receipt Processor (AI Builder). Before proceeding further, I would like to inform you that to use this feature you need to enable the AI\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/09\/how-to-use-receipt-processor-ai-builder-in-canvas-app\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1954],"tags":[1867,244,245,545],"class_list":["post-24717","post","type-post","status-publish","format-standard","hentry","category-canvas-apps","tag-canvas-app","tag-canvas-app-in-dynamics365","tag-canvas-app-in-dynamics365-crm","tag-dynamics-365-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/24717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=24717"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/24717\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=24717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=24717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=24717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}