<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dinakar S on Medium]]></title>
        <description><![CDATA[Stories by Dinakar S on Medium]]></description>
        <link>https://medium.com/@dinakars2003?source=rss-1bea5164d926------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*3zZJ9AijLFE9Stcy</url>
            <title>Stories by Dinakar S on Medium</title>
            <link>https://medium.com/@dinakars2003?source=rss-1bea5164d926------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 22:06:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dinakars2003/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Real-Time Legal Document Automation With Azure Functions, Docxtemplater, and CRM]]></title>
            <link>https://medium.com/@dinakars2003/building-real-time-legal-document-automation-with-azure-functions-docxtemplater-and-crm-846a16cfbd79?source=rss-1bea5164d926------2</link>
            <guid isPermaLink="false">https://medium.com/p/846a16cfbd79</guid>
            <category><![CDATA[doctemplater]]></category>
            <category><![CDATA[document-generation]]></category>
            <category><![CDATA[docx]]></category>
            <category><![CDATA[azure-functions]]></category>
            <category><![CDATA[legaltech]]></category>
            <dc:creator><![CDATA[Dinakar S]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 07:30:45 GMT</pubDate>
            <atom:updated>2026-02-09T07:30:45.453Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How a 100+ page Agreement finally became predictable</em></p><p>Automating a legal agreement is not the same as generating a letter or invoice.</p><p>Once you cross 30 or 40 pages, most document tools quietly fall apart. Formatting drifts. Numbering breaks. Conditional clauses leave blank gaps. Tables behave differently every time someone adds a row.</p><p>I hit all of this while rebuilding a <strong>full Facility Agreement</strong> using Zoho CRM as the source of truth, Azure Functions as the execution layer, and Docxtemplater as the document engine.</p><p>This post walks through the real setup, the Azure Function creation steps, and the kind of JSON structure that actually survives complex legal automation.</p><h3>The Architecture That Finally Worked</h3><p>The final flow looked like this:</p><ol><li>Zoho CRM stores deal, borrower, guarantor, property, and security data</li><li>A Zoho workflow triggers document generation</li><li>Azure Function (Node.js) receives the request</li><li>CRM data is reshaped into document-first JSON</li><li>Docxtemplater renders the DOCX in real time</li><li>The generated document is returned or stored back</li></ol><p>The key insight was separation of concerns.</p><p>Zoho stayed a CRM.<br>Azure Functions handled orchestration and logic.<br>Docxtemplater owned the Word document structure.</p><p>Once those lines were clear, the system stopped fighting itself.</p><h3>Why Azure Functions Fit This Use Case</h3><p>Azure Functions solved several problems without adding new ones.</p><h3>Stateless by Design</h3><p>Each document generation request is independent.</p><p>No long-running servers. No background Word processes. The function spins up, generates the document, and exits.</p><p>That alone avoids a whole category of production issues.</p><h3>Clean HTTP Boundary</h3><p>The function exposes a simple HTTP endpoint:</p><ul><li>Input: JSON payload</li><li>Output: DOCX buffer or storage reference</li></ul><p>That made it easy to call from Zoho, Power Automate, or even curl during debugging.</p><h3>Node.js Without Container Overhead</h3><p>Docxtemplater works best in Node.js.</p><p>Azure Functions let me run it directly without Docker, VMs, or infrastructure noise.</p><p>Cold starts exist, but for document generation they were acceptable.</p><h3>Creating the Azure Function App Step by Step</h3><p>These are the exact steps used.</p><h3>Step 1: Open Azure Portal</h3><p>Go to<br><a href="https://portal.azure.com/">https://portal.azure.com/</a></p><h3>Step 2: Create a New Resource</h3><p>Search for <strong>Function App</strong> and select it.</p><h3>Step 3: Choose Hosting Plan</h3><p>Pick the hosting plan based on your usage.</p><p>Flex Consumption works well here:</p><ul><li>Faster scaling</li><li>Pay as you go billing</li><li>No server management</li></ul><h3>Step 4: Fill Required Details</h3><p>Provide the following:</p><ul><li>Resource Group<br>Create a new one or reuse an existing group</li><li>Function App Name<br>No spaces allowed</li><li>Region<br>Choose the nearest region to your CRM or users</li><li>Runtime Stack<br>Node.js, Python, etc<br>For Docxtemplater, Node.js is the practical choice</li><li>Version and Instance Size<br>Defaults are fine unless you know otherwise</li></ul><h3>Step 5: Review and Create</h3><p>Click <strong>Review + Create</strong>, then <strong>Create</strong>.</p><h3>Step 6: Wait for Deployment</h3><p>Deployment usually takes a few minutes.</p><p>Once completed, open the Function App.</p><h3>Step 7: Create a Function Inside the App</h3><p>Inside the Function App:</p><ul><li>Click <strong>Create</strong></li><li>Choose <strong>HTTP trigger</strong></li><li>Provide a function name</li></ul><p>This function becomes your document generation endpoint.</p><h3>Installing Libraries in Azure Functions</h3><p>Azure Functions do not include Docxtemplater or related libraries by default.</p><p>They must be installed manually.</p><h3>Step 8: Open Advanced Tools</h3><p>In the Function App left menu:</p><p>Development Tools<br>→ Advanced Tools<br>→ Click <strong>Go</strong></p><h3>Step 9: Open Kudu Console</h3><p>You will see Kudu Services.</p><ul><li>Click <strong>Debug Console</strong></li><li>Choose <strong>CMD</strong></li></ul><h3>Step 10: Navigate to the Function Directory</h3><pre>cd site/wwwroot/</pre><h3>Step 11: Install Required Libraries</h3><p>For this use case:</p><pre>npm install express docxtemplater pizzip cors body-parser</pre><p>If you were using Python, this is where pip install would be used instead.</p><h3>Step 12: Start Building the Logic</h3><p>At this point the environment is ready.</p><p>You can now implement:</p><ul><li>HTTP request handling</li><li>Zoho CRM data fetching</li><li>JSON normalization</li><li>Document generation</li></ul><h3>Step 13: Learn Docxtemplater Tags Properly</h3><p>Docxtemplater’s power comes from its tag system.</p><p>This documentation is essential:<br><a href="https://docxtemplater.com/docs/tag-types/">https://docxtemplater.com/docs/tag-types/</a></p><p>Loops, conditions, and paragraph control are what make legal documents possible at scale.</p><h3>Designing JSON for Legal Documents</h3><p>This was the hardest and most important part.</p><p>CRM data models do not map cleanly to Word documents.</p><p>You need a <strong>document-first JSON structure</strong>, not a CRM mirror.</p><p>Below is a realistic dummy dataset that reflects how a Secured Facility Agreement actually behaves.</p><pre>const data = {<br>  &quot;Reference&quot;: &quot;Document-001-ABC-Holdings&quot;,<br>  &quot;Letter_of_offer_Date&quot;: &quot;06 February 2026&quot;,<br>  &quot;Deal_Name&quot;: &quot;ABC Holdings Facility&quot;,<br>  &quot;Facility_Limit&quot;: &quot;$4,500,000.00&quot;,<br>  &quot;Borrower_or_Guarantor&quot;: &quot;ABC Holdings Pty Ltd&quot;<br>};</pre><p>This structure is intentional.</p><p>Flags drive conditions.<br>Arrays drive loops.<br>Grammar and numbering stay inside the template.</p><p>That separation is what keeps the document sane.</p><h3>Why Docxtemplater Was the Turning Point</h3><p>Docxtemplater solved problems that kept breaking other tools.</p><h3>Real Loops, Not Hacks</h3><p>Borrowers, guarantors, properties, securities.</p><p>Entire sections and tables repeat naturally without cloning or scripting Word.</p><h3>Conditional Clauses That Truly Disappear</h3><p>Clauses can be fully removed when conditions are false.</p><p>No empty headings. No numbering gaps. No visible template scars.</p><p>This matters in legal review more than most people realize.</p><h3>Tables That Do Not Collapse</h3><p>Rows expand cleanly.</p><p>Column widths, fonts, borders, and spacing remain intact.</p><h3>DOCX Formatting Is Preserved</h3><p>Fonts, numbering, spacing, and styles stay exactly as designed.</p><p>For agreements exceeding 100 pages, this is non-negotiable.</p><h3>Why Zoho Writer Did Not Hold Up</h3><p>Zoho Writer was evaluated seriously.</p><p>It works fine for small documents.</p><p>It breaks down for long legal agreements.</p><p>Issues we hit:</p><ul><li>Formatting degradation on long documents</li><li>Conditional content leaving spacing artifacts</li><li>Numbering inconsistencies</li><li>ODT uploads only working reliably under about 50 pages</li></ul><p>For complex legal documents, the output became messy very quickly.</p><p>Docxtemplater handled the same templates cleanly, consistently, and predictably.</p><h3>Full Working Code on GitHub</h3><p>I have published the full working setup on GitHub, including:</p><ul><li>Local development setup</li><li>Docxtemplater configuration</li><li>Sample JSON</li><li>Azure Functions compatible structure</li></ul><p>You can view the project here:</p><p><a href="https://github.com/DINAKAR-S/Docxtemplater">GitHub - DINAKAR-S/Docxtemplater: Generate large, format-safe Word documents from CRM data using Docxtemplater in an Azure Function.</a></p><p>If you are moving from local testing to Azure Functions, this repo should save you real time.</p><h3>Final Thoughts</h3><p>Rebuilding a Facility Agreement through automation exposed every weakness in document tools.</p><p>Azure Functions gave a clean execution layer.</p><p>Docxtemplater gave real structural control over Word documents.</p><p>The hardest part was not coding. It was understanding how legal documents actually behave when content is optional, repeated, or conditional.</p><p>Once that clicked, everything else followed.</p><p>If this helped you, follow me for more real-world automation and technical breakdowns.</p><p><strong><em>Dinakar S</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=846a16cfbd79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Integrated Equifax “Land Titles API” — Search → Order → Deliver]]></title>
            <link>https://medium.com/@dinakars2003/how-i-integrated-equifax-land-titles-api-search-order-deliver-0e1f13adfc47?source=rss-1bea5164d926------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e1f13adfc47</guid>
            <category><![CDATA[equifax]]></category>
            <category><![CDATA[equifax-api-integration]]></category>
            <category><![CDATA[titlesearch]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[xml]]></category>
            <dc:creator><![CDATA[Dinakar S]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 10:26:19 GMT</pubDate>
            <atom:updated>2026-01-27T10:26:19.446Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Integrated Equifax “Land Titles API” — Search → Order → Deliver</h3><p>When I started working with Equifax Australia’s Land Titles Connect API, I honestly thought it would be similar to most modern APIs I’ve worked with.</p><p>You know the normal flow:</p><p>✅ Send JSON request<br>✅ Get JSON response<br>✅ Save data to DB<br>✅ Done</p><p>But Land Titles Connect is a different story.</p><p>This integration was one of the most challenging API setups I’ve done — not because the business concept is hard, but because the technical format and process is very enterprise-focused:</p><ul><li>SOAP XML messages (not REST JSON)</li><li>WSSE UsernameToken authentication</li><li>Namespaces everywhere</li><li>Multi-step flow (Search → Order → Deliver)</li><li>Delivery requires polling until READY</li><li>Raw document content comes inside XML-escaped blocks</li><li>Data needs cleaning before you can use it in automation tools like Zoho Creator</li></ul><p>So I’m sharing this article to help other developers avoid the same pain, and to provide a clean mental model of how the whole process works.</p><h3>What is Equifax Land Titles Connect API used for?</h3><p>Equifax Land Titles Connect is commonly used in Australian business workflows where you need official land title documents from state registries.</p><p>In a real company environment, this is useful for:</p><ol><li>Mortgage lending / loan approvals</li><li>Security property verification</li><li>Conveyancing workflows</li><li>Compliance checks</li><li>Automated title search creation</li><li>Confirming ownership, mortgages, caveats, and related interests</li></ol><p>Instead of employees manually requesting title searches, the API allows a system to:</p><p>✅ search the title reference<br>✅ order the document<br>✅ download/deliver it<br>✅ extract key details<br>✅ store it into your internal CRM or database</p><h3>The biggest challenge: SOAP is not JSON</h3><p>Most developers today are comfortable with JSON APIs.</p><h3>Why JSON is easy</h3><p>JSON APIs are simple because:</p><ul><li>Lightweight format</li><li>Easy to read</li><li>Keys/values map directly to dictionaries/objects</li><li>Works naturally in Postman, JavaScript, Python, Node, etc.</li><li>Parsing is straightforward: response.data.fieldName</li></ul><p>In JSON, you don’t worry about:</p><ul><li>XML namespaces</li><li>SOAP headers</li><li>WSSE security format</li><li>XML encoding/escaping</li><li>Complex nested tags</li></ul><h3>Why SOAP/XML is complex</h3><p>SOAP is powerful, but heavy.</p><p>With SOAP, even a “simple request” feels like a full document, not an API call.</p><p>You deal with:</p><p>Namespaces like xmlns:wsa=”…” etc.</p><p>And unlike JSON APIs where the endpoint name changes (example: /search, /order, /deliver), here you often hit the same endpoint but change the SOAP action.</p><p>That’s confusing initially because it doesn’t feel like a “normal API design”.</p><h3>Why I built this integration</h3><p>In my company use case, we needed an automation to:</p><ol><li>Read Security Property address details from a CRM (Zoho Creator in my case)</li><li>Search the Land Title references available for that property</li><li>Order the official title document</li><li>Deliver the document once READY</li><li>Extract essential title info and save it back into Zoho Creator records automatically</li></ol><p>This means the system can create title searches in the background instead of someone doing it manually.</p><h3>The correct workflow: Search → Order → Deliver</h3><p>This is the most important part.</p><p>Land Titles Connect is NOT a single API call.</p><p>It’s a chain of steps:</p><h4>Step 1: Search Land Title (Find Title Reference)</h4><p>This is the first API call.</p><p>You search by:</p><ul><li>Address</li><li>Name</li><li>Lot/Plan</li></ul><p>The most common is Search by Address.</p><p>Why search is required</p><p>You cannot order a title without knowing the correct Title Reference.</p><p>Example Title Reference format:</p><ul><li>NSW: xxxx/752038</li><li>VIC: xxxxx/043</li><li>QLD: numeric references like 14243123</li></ul><p>What you get from Search</p><p>The search result returns:</p><ul><li>title reference(s)</li><li>description</li><li>document price</li></ul><p>Sometimes you get:</p><ol><li>one exact match (same address might have multiple titles)</li><li>multiple matches</li></ol><p>So in automation, you usually store all title references found and decide what to do next.</p><h4>Step 2: Order Document (Get Enquiry ID)</h4><p>Once you have a Title Reference, you must order the title document.</p><p>This request returns something very important:</p><blockquote>enquiry-id</blockquote><p>This ID is like a ticket number.</p><p>You cannot download the title document without this.</p><p>Think of it like:</p><ul><li>Search gives you the product name</li><li>Order gives you the receipt</li><li>Deliver gives you the final file</li></ul><h4>Step 3: Deliver Document (Poll until READY)</h4><p>This is the part that surprises many developers.</p><p>Even after ordering, the document might not be ready instantly.</p><p>So the Deliver API returns a status such as:</p><ul><li>READY ✅</li><li>PENDING / IN_PROGRESS ⏳</li><li>FAILURE ❌</li></ul><p>Why polling is needed</p><p>Because the registry might need time to generate the document or check conditions.</p><p>So in real integration logic, you do something like:</p><ol><li>call deliver if not READY → wait and call again</li><li>stop after X attempts to avoid endless loops</li></ol><p>This step is critical in production because you want reliability and safe retry logic.</p><h3>Real pain point: The title document is not “clean text”</h3><p>Once you deliver and it becomes READY, the response contains the title data…</p><p>But it’s usually inside an XML field that is escaped.</p><p>That means you’ll see things like:</p><p>&amp;l;body&amp;g;<br>&amp;l;/body&amp;g;</p><p>So even after success, you still have another job:</p><ol><li>clean the content</li><li>decode it to normal text</li><li>extract only the useful sections</li></ol><h3>My automation approach (Zoho Creator integration)</h3><p>I built this full workflow inside Zoho Creator using Deluge.</p><h4>The logic was:</h4><ol><li>Read the address from Zoho Creator forms</li><li>Parse the address into SOAP-compatible format</li><li>Search Land Titles by address</li><li>Order each Title Reference</li><li>Deliver and poll until READY</li><li>Extract content</li><li>Match borrower / guarantor names</li><li>Save output into Zoho Creator records</li></ol><p>This becomes a fully automated title search record creation.</p><h3>Optional: Extract structured fields using OpenAI</h3><p>After receiving the raw document body, extracting key fields using rules is hard because:</p><ul><li>format changes between NSW/VIC/QLD</li><li>ownership appears in different sections</li><li>mortgage/caveat words vary</li><li>documents contain a lot of legal wording</li></ul><p>So I added an optional OpenAI extraction step.</p><h4>Why AI helps here</h4><p>Because it converts:</p><ul><li>unstructured legal title search text into</li><li>clean consistent JSON fields</li></ul><p>For example:</p><ul><li>Lot Number</li><li>Plan Number</li><li>Names on title</li><li>Ownership capacity (joint tenants, etc.)</li><li>Mortgage instrument and mortgagee</li><li>Caveat instrument and caveator</li></ul><p>In real production systems, this saves huge time and reduces manual work.</p><h3>Where to find official documentation</h3><p>Equifax provides API documentation through their developer centre:</p><p><a href="https://developercentre.equifax.com.au/">Equifax Developer Centre (Australia)</a></p><p>This documentation is essential to understand:</p><ol><li>production vs testing environments</li><li>credential setup</li><li>request requirements</li><li>registry-specific conditions</li></ol><h3>Final thoughts</h3><p>If you’re a developer who only worked with JSON REST APIs, integrating Equifax Land Titles Connect can feel overwhelming.</p><p>But once you understand the process:</p><ol><li>Search → Order → Deliver</li><li>poll until READY</li><li>extract and clean document content</li><li>save into your system</li></ol><p>…it becomes manageable and extremely powerful for enterprise automation.</p><p>In my case, integrating this into Zoho Creator turned a manual workflow into a fully automated one — and that’s what enterprise API integration is all about.</p><p>Thanks for reading — hope this saves you time in your own integrations.</p><p><strong>Dinakar S</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e1f13adfc47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build Document Processing with Azure Document Intelligence (Studio + Custom Models + Python)]]></title>
            <link>https://medium.com/@dinakars2003/how-to-build-document-processing-with-azure-document-intelligence-studio-custom-models-python-82063456cdbe?source=rss-1bea5164d926------2</link>
            <guid isPermaLink="false">https://medium.com/p/82063456cdbe</guid>
            <category><![CDATA[document-processing]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[azure-form-recognizer]]></category>
            <dc:creator><![CDATA[Dinakar S]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 17:26:28 GMT</pubDate>
            <atom:updated>2026-01-21T17:32:19.935Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*rfcXhK1Y7p-DAT5VMW9w8g.png" /></figure><h4>Step-by-Step Guide to Azure Document Intelligence: From Setup to Real-World Use</h4><p>In today’s digital world, almost every organization works with documents. These documents can be invoices, resumes, contracts, legal deeds, scanned forms, PDFs, or even handwritten notes. While these documents contain critical business information, most of the time they are unstructured and cannot be easily processed by traditional software systems.</p><p>This is where <strong>Azure Document Intelligence</strong> becomes extremely useful.</p><p>Azure Document Intelligence (previously known as Form Recognizer and now part of Azure AI Foundry Tools) is a cloud-based AI service that helps you extract structured data from unstructured documents. It can read text, understand layout, extract key fields, classify documents, and even train custom models for domain-specific documents.</p><p>In simple terms, Azure Document Intelligence helps you convert messy documents into clean, machine-readable data.</p><h3>What is Azure Document Intelligence?</h3><p>Azure Document Intelligence is a cloud service provided by Microsoft that allows you to build intelligent document processing solutions. Large volumes of business data exist inside documents and forms, and this service helps you process that data automatically.</p><p>It supports multiple capabilities:</p><p><strong>Read (OCR):</strong><br>Extract printed and handwritten text from images and scanned documents.</p><p><strong>Layout:</strong><br>Extract tables, columns, headings, checkboxes, and document structure.</p><p><strong>General Document:</strong><br>Extract key-value pairs, selection marks, and semantic structure.</p><p>These features allow developers to build automation pipelines such as invoice processing systems, resume parsers, legal document analyzers, and KYC systems.</p><p>Refer more on : <a href="https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/">https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/</a></p><h3>Step 1: Login to Azure Portal</h3><p>First, go to the Azure portal:</p><p><a href="https://portal.azure.com/">https://portal.azure.com/</a></p><p>Login using your Microsoft account.</p><p>This is the main dashboard where you manage all Azure services.</p><h3>Step 2: Create Azure Document Intelligence Resource</h3><p>Once logged in:</p><p>Click on <strong>Create a resource</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGVbjoP6xIii084uCaIv-A.png" /></figure><p>In the search bar, type <strong>Azure Document Intelligence</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvFta5TfjDmTkheeUIgSsw.png" /></figure><p>Select <strong>Document Intelligence (Form Recognizer)</strong> from the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6TegFB5Mk09xn0EdSdjAg.png" /></figure><p>Click on <strong>Create</strong>.</p><h3>Step 3: Configure the Resource</h3><p>You will now see a configuration form. Fill in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Job7T_d5xtESs32h--kuZQ.png" /></figure><ul><li>Subscription: Your Azure subscription.</li><li>Resource Group: Create a new one (recommended) so you can track costs easily.</li><li>Region: Choose the nearest region.</li><li>Name: Give a meaningful name (for example: document-ingestion).</li><li>Pricing Tier: Choose Free (F0) for testing.</li></ul><p>The free tier provides:</p><ul><li>500 pages per month</li><li>20 calls per minute</li></ul><p>Now click <strong>Review + Create</strong>, then <strong>Create</strong>.</p><p>Wait for the deployment to complete.</p><h3>Step 4: Get Keys and Endpoint</h3><p>After deployment:</p><ol><li>Click <strong>Go to Resource</strong>.</li><li>In the left menu, find <strong>Keys and Endpoint</strong>.</li><li>Copy:</li></ol><ul><li>Endpoint URL</li><li>Either Key 1 or Key 2</li></ul><p>These are required to connect your application with Azure Document Intelligence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPL_VcjpN_gQJZvkzKcfiw.png" /></figure><h3>Step 5: Open Document Intelligence Studio</h3><p>From your resource page, click:</p><p><strong>Go to Document Intelligence Studio</strong></p><p>Or open directly:</p><p><a href="https://contentunderstanding.ai.azure.com/documentintelligence/">https://contentunderstanding.ai.azure.com/documentintelligence/</a></p><p>This is a web interface where you can test, train, and deploy models without writing code.</p><h3>Understanding the Studio Interface</h3><p>You will see three main sections:</p><h3>Document Analysis</h3><p>Used for one-time OCR and layout extraction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-KbvARxv_1E1u8a0K-edw.png" /></figure><h3>Prebuilt Models</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GhNu49q_RJnIQEbPoWyIGA.png" /></figure><p>Used for common document types such as:</p><ul><li>Passport</li><li>Driving License</li><li>Invoices</li><li>Receipts</li><li>Contracts</li><li>US health insurance cards</li></ul><p>These models work instantly without training.</p><h3>Custom Models</h3><p>Used when your documents are unique and no template exists.</p><h3>Using Document Analysis</h3><p>In Document Analysis, you will find three services:</p><p><strong>OCR / Read</strong><br>Extract printed and handwritten text from images and PDFs.</p><p><strong>Layout</strong><br>Extract tables, checkboxes, and document structure.</p><p><strong>General Document</strong><br>Extract key-value pairs and selection marks.</p><p>When you select any service, you need to choose:</p><ul><li>Subscription</li><li>Resource group</li><li>Document Intelligence resource</li></ul><p>You can test with:</p><ul><li>Microsoft sample files</li><li>Your own documents</li></ul><p>The output can be viewed in JSON or markdown-like formats.</p><h3>When to Use Prebuilt Models</h3><p>Use prebuilt models when your document type already exists, such as:</p><ul><li>Passport</li><li>Invoice</li><li>Receipt</li><li>Tax forms</li><li>Identity cards</li></ul><p>These models require no training and give good accuracy.</p><h3>When to Use Custom Models</h3><p>Use custom models when:</p><ul><li>Documents vary heavily.</li><li>Internal company formats.</li><li>Legal agreements.</li><li>Banking statements.</li><li>HR resumes.</li></ul><p>Custom models require at least 10–12 documents per document type.</p><h3>Creating a Custom Classification Model</h3><p>Classification answers one simple question:</p><p><em>“What type of document is this?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtE-Lc2TZUm3Ol3VtRmwYg.png" /></figure><p>Steps:</p><p>Go to <strong>Custom Models</strong>.</p><p>Click <strong>Create Custom Classification Model</strong>.</p><p>Click <strong>Create a Project</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b5vtHYOE9rTt-7FtQlJO5A.png" /></figure><p>Enter project name and description.</p><p>Select or create a storage account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BweBopgVxz0_58jGdX8pxw.png" /></figure><h3>Storage Account Explanation</h3><p>You will need a Blob Storage account to store training data.</p><p>Recommended configuration:</p><ul><li>Type: Standard General Purpose v2 (GPv2)</li><li>Redundancy: LRS (Locally Redundant Storage)</li><li>Tier: Hot</li></ul><p>Explanation:</p><p>LRS is the cheapest option and stores three copies in one data center.<br>GRS stores data in another region for disaster recovery.<br>RA-GRS allows read access to backup region.<br>ZRS distributes across availability zones.</p><p>Hot tier is best for frequent access. Archive is cheapest but slow.</p><h3>Upload Training Dataset</h3><p>For this tutorial, I used a dataset from Kaggle:</p><p><a href="https://www.kaggle.com/datasets/shaz13/real-world-documents-collections/data">https://www.kaggle.com/datasets/shaz13/real-world-documents-collections/data</a></p><p>I selected resumes.</p><p>Upload at least 10 documents for each document type.</p><p>You can create categories using <strong>Add Type</strong>.</p><p>Example:</p><ul><li>resumes</li><li>agreements</li><li>deeds</li></ul><h3>Train Classification Model</h3><p>Once documents are uploaded:</p><ol><li>Click <strong>Train</strong>.</li><li>Enter model name and description.</li><li>Wait for training to complete.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EW8114GrJhxxrlJKy-4HOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUs0MKtkp7qkAYqQpeWDAg.png" /></figure><p>After training:<br>Go to <strong>Models tab</strong> to view trained models.</p><h3>Test Classification Model</h3><p>Click <strong>Test</strong>:</p><ul><li>Upload any document.</li><li>Select your trained model.</li><li>Click <strong>Test</strong>.</li></ul><p>You will see:</p><ul><li>Predicted document type.</li><li>Confidence score.</li></ul><h3>Creating Custom Extraction Model</h3><p>Extraction answers:<br><em>“What information exists inside this document?”</em></p><p>Steps are similar to classification:</p><ol><li>Create extraction project.</li><li>Upload documents.</li><li>Label fields visually.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*93DuD8yxioq1FDEIejksJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zP5F2cogenZcD24U1QEu6Q.png" /></figure><p>Example fields:</p><ul><li>Name</li><li>Date of birth</li><li>Total amount</li><li>Address</li></ul><p>Click <strong>Train</strong>.</p><p>The model now learns how to extract structured fields.</p><h3>Python Integration</h3><p>Install SDK:</p><p>pip install azure-ai-documentintelligence</p><p>Set environment variables:</p><p>DOCUMENTINTELLIGENCE_ENDPOINT<br>DOCUMENTINTELLIGENCE_API_KEY</p><p>Refer Official docs here: <a href="https://learn.microsoft.com/en-us/python/api/overview/azure/ai-documentintelligence-readme?view=azure-python">https://learn.microsoft.com/en-us/python/api/overview/azure/ai-documentintelligence-readme?view=azure-python</a></p><h3>Sample Python Code (Classification)</h3><p>This code sends a local PDF to Azure and classifies it.</p><p>Code Link: <a href="https://github.com/DINAKAR-S/Azure-Document-Intelligence/blob/main/azure_doc_intelligence.py">https://github.com/DINAKAR-S/Azure-Document-Intelligence/blob/main/azure_doc_intelligence.py</a></p><p>You provide:</p><ul><li>Endpoint</li><li>Key</li><li>Classifier ID</li><li>PDF file</li></ul><p>It returns:</p><ul><li>Document type</li><li>Confidence score</li><li>Page numbers</li></ul><p>This allows you to integrate Azure Document Intelligence into any backend system.</p><h3>Real World Use Case</h3><p>In my project, the requirement was:</p><ul><li>No fixed templates.</li><li>Every document is different.</li><li>Legal deeds.</li><li>Agreements.</li><li>Contracts.</li></ul><p>Problems:</p><ul><li>Passport differs per country.</li><li>Driving license differs per state.</li><li>No universal template exists.</li></ul><p>Solution architecture:</p><ol><li>First classify document.</li><li>Then extract raw text.</li><li>Convert output into markdown.</li><li>Send markdown to LLM.</li><li>Ask LLM to interpret document.</li></ol><p>This creates a powerful AI pipeline.</p><h3>Why Combine with LLMs?</h3><p>Azure gives structured data.<br>LLMs give reasoning.</p><p>Azure output:</p><ul><li>Fields</li><li>Tables</li><li>Text</li></ul><p>LLM understands:</p><ul><li>Meaning</li><li>Context</li><li>Risk</li><li>Summary</li></ul><p>Together they form a complete intelligent system.</p><h3>Final Architecture</h3><p>User uploads document<br>→ Azure Blob Storage<br>→ Classification Model<br>→ Extraction Model<br>→ Database / Search Index<br>→ LLM / Analytics</p><h3>Common Mistakes</h3><p>Using too few training documents leads to poor accuracy.<br>Low-quality scans reduce OCR reliability.<br>Inconsistent labeling breaks models.<br>Skipping classification causes wrong routing.</p><h3>Final Thoughts</h3><p>Azure Document Intelligence is not just an OCR tool — it is a complete platform for building intelligent document processing systems. From simple text extraction to complex classification and custom field extraction, it provides everything needed to automate document-heavy workflows.</p><p>When combined with modern AI systems like Large Language Models (LLMs), Azure Document Intelligence becomes even more powerful. It enables you to build systems that not only read documents, but also understand them, reason over them, and take meaningful actions based on their content.</p><p>Whether you are building:</p><ul><li>Resume screening systems</li><li>Legal document analysis platforms</li><li>Invoice automation pipelines</li><li>KYC and compliance tools</li></ul><p>Azure Document Intelligence gives you a strong, scalable foundation.</p><p><strong>Happy Building!</strong></p><p><strong>Dinakar S</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82063456cdbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating an AI Document Pipeline with Zoho Creator & CRM: From Extracted Data to Real FinTech…]]></title>
            <link>https://medium.com/@dinakars2003/integrating-an-ai-document-pipeline-with-zoho-creator-crm-from-extracted-data-to-real-fintech-56e2059619e2?source=rss-1bea5164d926------2</link>
            <guid isPermaLink="false">https://medium.com/p/56e2059619e2</guid>
            <category><![CDATA[zoho-creator]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[microsoft-power-automate]]></category>
            <category><![CDATA[azureaifoundry]]></category>
            <category><![CDATA[document-automation]]></category>
            <dc:creator><![CDATA[Dinakar S]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 14:36:55 GMT</pubDate>
            <atom:updated>2026-01-09T06:02:44.806Z</atom:updated>
            <content:encoded><![CDATA[<h3>Integrating an AI Document Pipeline with Zoho Creator &amp; CRM: From Extracted Data to Real FinTech Workflows</h3><p>In Part 1, I explained how I built an automated document ingestion and understanding pipeline using SharePoint, Power Automate, Azure Document Intelligence, and LLMs. By the end of that system, documents were reliably classified and extracted despite coming from different vendors, formats, and layouts.</p><figure><img alt="Documents are ingested via SharePoint and email, processed using Azure Document Intelligence and LLMs, and converted into structured deal data inside Zoho — without manual data entry." src="https://cdn-images-1.medium.com/max/1024/1*1goxuWOFWNpJ4SvvJ8TDdg.png" /><figcaption>AI Document Extraction → Business Workflow Integration</figcaption></figure><p>But document understanding alone does not solve a business problem.</p><blockquote>The real challenge starts after extraction:<br> “How do we push this data safely into a live deal system and actually use it?”</blockquote><p>This blog (Part 2) covers how I integrated the AI document pipeline with <strong>Zoho Creator and Zoho CRM</strong>, handled authentication, routed extracted values into the correct deal records, and ultimately used that data to generate real legal and credit documents.</p><p>This is the part most demos never show.</p><p><strong>System context before integration</strong></p><p>At this stage, the system already had:</p><ul><li>Documents uploaded to SharePoint</li><li>Power Automate triggering on upload</li><li>Azure Document Intelligence extracting text in markdown format</li><li>LLMs classifying and extracting structured JSON</li><li>Outputs validated in Google Sheets</li></ul><p>Now the goal was to make this data <strong>usable inside Zoho</strong>, where deals are created and managed.</p><p><strong>Why Zoho Creator (not just Zoho CRM)</strong></p><p>Zoho CRM is excellent for deal pipelines and sales workflows, but it is not ideal for:</p><ul><li>Document-heavy data</li><li>Incremental updates from AI</li><li>Complex validation logic</li><li>Multi-form document storage</li></ul><p>Zoho Creator was used as the <strong>automation and processing layer</strong>, while CRM remained the origination system.</p><p>The design decision was simple:</p><blockquote>CRM = deal lifecycle<br>Creator = document intelligence + automation engine</blockquote><p><strong>High-level integration flow (Part 2)</strong></p><p>Conceptually, the system now looked like this:</p><blockquote>SharePoint<br> → Power Automate<br> → Azure Document Intelligence (markdown extraction)<br> → LLM (classification + extraction)<br> → Power Automate<br> → Zoho Creator (forms per document type)<br> → Zoho Writer / Docxtemplater<br> → Generated documents stored back in Creator</blockquote><p><strong>Zoho authentication from Power Automate (critical part)</strong></p><p>Zoho APIs require OAuth tokens. Power Automate does not natively manage Zoho OAuth for Creator APIs, so I implemented token refresh manually using an HTTP node.</p><p>This HTTP request was used to generate an access token from a refresh token:</p><pre>POST https://accounts.zoho.com.au/oauth/v2/token<br>?refresh_token=REFRESH_TOKEN_VALUE<br>&amp;client_id=CLIENT_ID<br>&amp;client_ecret=CLIENT_SECRET<br>&amp;grant_type=refresh_token</pre><p>The response schema looked like this:</p><pre>{<br>  &quot;access_token&quot;: &quot;string&quot;,<br>  &quot;refresh_token&quot;: &quot;string&quot;,<br>  &quot;api_domain&quot;: &quot;string&quot;,<br>  &quot;token_type&quot;: &quot;string&quot;,<br>  &quot;expires_in&quot;: 3600<br>}</pre><p>Two things mattered here:</p><ol><li>The access_token (used for Authorization headers)</li><li>The api_domain (Zoho is region-aware; this must be used in subsequent API calls)</li></ol><p>This response was parsed using a Parse JSON action in Power Automate.</p><p><strong>Sending extracted data into Zoho Creator forms</strong></p><p>Once the access token and api_domain were available, Power Automate could post extracted values into Zoho Creator.</p><p>Each document type had a corresponding Creator form.</p><p>Example: Assets &amp; Liabilities document</p><p>Power Automate HTTP action:</p><pre>POST @{api_domain}/creator/v2.1/data/companyx/test/form/Doc_type_Name</pre><p>Headers:</p><pre>Authorization: Zoho-oauthtoken ACCESS_TOKEN<br>Content-Type: application/json</pre><p>Body example:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;Guarantors&quot;: &quot;John Doe&quot;,<br>    &quot;Total_Current_Debt_String&quot;: &quot;1200000&quot;,<br>    &quot;Customer_Name&quot;: &quot;ABC Holdings Pty Ltd&quot;,<br>    &quot;Document_ID&quot;: &quot;29112000000070063&quot;,<br>    &quot;Status&quot;: &quot;&quot;<br>  }<br>}</pre><p>The <strong>Document_ID</strong> is the Deal ID.<br> This single field ensures that every extracted document is linked back to the correct deal.</p><p>This pattern was reused across all document types.</p><p><strong>Calling AI Foundry / Azure OpenAI from Power Automate</strong></p><p>To extract structured data from markdown text, Power Automate directly called the AI Foundry (Azure OpenAI-compatible) endpoint.</p><p>Example HTTP node:</p><pre>POST https://document-classifier-assistant.openai.azure.com/openai/deployments/gpt-4o-mini/chat/completions?api-version=2025-01-01-preview</pre><p>Headers:</p><pre>Content-Type: application/json<br>api-key: YOUR_API_KEY</pre><p>Body:</p><pre>{<br>  &quot;model&quot;: &quot;gpt-4o&quot;,<br>  &quot;messages&quot;: [<br>    {<br>      &quot;role&quot;: &quot;system&quot;,<br>      &quot;content&quot;: &quot;You are a document analyst. Extract required fields from the input text and return strict JSON only.&quot;<br>    },<br>    {<br>      &quot;role&quot;: &quot;user&quot;,<br>      &quot;content&quot;: &quot;Here is the Assets &amp; Liabilities document:\n\n&lt;MARKDOWN_FROM_AZURE_DI&gt;&quot;<br>    }<br>  ]<br>}</pre><p>Important design choices here:</p><ul><li>Strict JSON output (no prose)</li><li>No hallucination allowed</li><li>Dates and currency normalized</li><li>Confidence flags added where possible</li></ul><p><strong>Deluge logic for safe data insertion</strong></p><p>Zoho Deluge was used to control how AI values were written into forms.</p><p>Key rules enforced in Deluge:</p><ul><li>Do not overwrite manually verified values</li><li>Allow partial updates</li><li>Track whether data came from AI or manual entry</li></ul><p>Example Deluge logic:</p><pre>if(input.Passport_Number != null)<br>{<br>    rec = Passport_Form[Deal_ID == input.Document_ID];<br>    if(rec.Passport_Verified != true)<br>    {<br>        rec.Passport_Number = input.Passport_Number;<br>        rec.Extracted_By = &quot;AI&quot;;<br>        rec.save();<br>    }<br>}</pre><p>This ensured AI assisted humans, not replaced them blindly.</p><p><strong>Email-based document ingestion from Zoho Creator</strong></p><p>Zoho Creator was configured to send emails when documents were required from customers.</p><p>Deluge code to send email with attachments:</p><pre>for each rec in input.Docs_Required<br>{<br>    if(rec.Mail_Sent == false)<br>    {<br>        sendmail<br>        [<br>            from : zoho.adminuserid<br>            to : &quot;email-id&quot;<br>            subject : &quot;Docs Required for &quot; + input.Deal_Name + &quot;-ID-&quot; + input.ID<br>            message : &quot;&lt;p&gt;Here are the required documents&lt;/p&gt;&quot;<br>            Attachments : file:rec.File_upload<br>        ]<br>        rec.Mail_Sent = true;<br>    }<br>}</pre><p>Power Automate monitored this mailbox.</p><p>Email trigger filters:</p><ul><li>From: notifications@mailer.zohocreatormail.com</li><li>Subject contains: “Docs Required for”</li><li>Fetch only emails with attachments</li></ul><p>Extracting deal name from subject:</p><pre>trim(<br>  split(triggerOutputs()?[&#39;body/subject&#39;], &#39;Docs Required for&#39;)[1]<br>)</pre><p>Attachments were then saved into SharePoint under a folder named after the deal, automatically triggering the document ingestion pipeline again.</p><p>This closed the loop.</p><p>What this system achieved</p><p>By the end of Part 2:</p><ul><li>AI-extracted data flowed safely into live deals</li><li>Humans could review and approve AI outputs</li><li>Legal documents were generated reliably</li><li>Manual copy-paste work was eliminated</li><li>The system remained auditable and compliant</li></ul><p>What’s next (Part 3)</p><p>In the next blog, I’ll cover:</p><ul><li>Document generation using Zoho Writer</li><li>Generating legal documents (ILOO, Credit Committee, SFA)</li><li>Why Docxtemplater saved a 180-page document project</li><li>Replacing document uploads with API integrations</li><li>Handling legacy SOAP/XML systems</li></ul><blockquote>This architecture and approach can be adapted to any document-heavy, regulated industry such as FinTech, LegalTech, Insurance, or Compliance.</blockquote><h3><strong>References</strong></h3><ol><li><strong>Azure AI Document Intelligence — Model Overview</strong><br> Used to understand the difference between prebuilt, layout, and custom models, and why format-trained models struggle with heterogeneous documents.<br> <a href="https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/model-overview?view=doc-intel-4.0.0">https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/model-overview?view=doc-intel-4.0.0</a></li><li><strong>Azure Document Intelligence — Prebuilt Layout Model</strong><br> Used to extract titles, paragraphs, tables, and structured text in markdown format before passing content to LLMs.<br> <a href="https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/prebuilt/layout?view=doc-intel-4.0.0">https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/prebuilt/layout?view=doc-intel-4.0.0</a></li><li><strong>Microsoft Power Automate — HTTP Actions</strong><br> Core reference for calling Zoho OAuth endpoints, Creator APIs, and Azure OpenAI from Power Automate flows.<br> <a href="https://learn.microsoft.com/en-us/power-automate/http-actions">https://learn.microsoft.com/en-us/power-automate/http-actions</a></li><li><strong>Azure OpenAI / AI Foundry — Chat Completions API</strong><br> Used to classify documents and extract structured fields from markdown text using large-context models.<br> <a href="https://learn.microsoft.com/en-us/azure/ai-services/openai/reference">https://learn.microsoft.com/en-us/azure/ai-services/openai/reference</a></li><li><strong>Zoho Creator REST APIs &amp; Deluge Scripting</strong><br> Used to insert extracted document data into deal-linked forms and control validation logic.<br> <a href="https://www.zoho.com/creator/help/api/">https://www.zoho.com/creator/help/api/</a><br> <a href="https://www.zoho.com/creator/help/script/">https://www.zoho.com/creator/help/script/</a></li></ol><blockquote>All tools and references used in this system are based on official documentation and production-grade APIs. The architecture can be adapted to any document-heavy, regulated industry beyond FinTech.</blockquote><p><strong>Closing thought</strong></p><p>Part 1 taught machines how to read documents.<br>Part 2 taught machines how to <strong>participate in real business workflows</strong>.</p><p><em>That gap is where most automation projects fail — and where real engineering begins.</em></p><h3>👋 If this helped you</h3><p>Follow me</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56e2059619e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a FinTech Document Ingestion Pipeline with Power Automate & Azure Document Intelligence]]></title>
            <link>https://medium.com/@dinakars2003/building-a-fintech-document-ingestion-pipeline-with-power-automate-azure-document-intelligence-26118596c303?source=rss-1bea5164d926------2</link>
            <guid isPermaLink="false">https://medium.com/p/26118596c303</guid>
            <category><![CDATA[document-automation]]></category>
            <category><![CDATA[microsoft-power-automate]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[azure-ai]]></category>
            <dc:creator><![CDATA[Dinakar S]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 11:48:10 GMT</pubDate>
            <atom:updated>2026-01-03T11:48:10.931Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>How I designed a scalable, AI-driven document ingestion system that replaces manual document analysis — handling mixed formats, multiple document types, and real-world inconsistencies.</blockquote><figure><img alt="Architecture diagram: SharePoint upload to Power Automate to Azure Document Intelligence to switch router then to GSheet, Zoho, and SharePoint destination." src="https://cdn-images-1.medium.com/max/1024/1*p0tLG3Swhlz2fNS36kVIsg.png" /><figcaption><em>Figure 1. System architecture: ingestion, classification, split, routing, and integration.</em></figcaption></figure><h3>Why I’m Writing This</h3><p>Every industry today is drowning in documents.</p><p>In <strong>FinTech</strong>, it’s worse:</p><ul><li>Lending deals involve <strong>dozens of document types</strong></li><li>Each document comes from <strong>different vendors</strong></li><li>Formats are inconsistent</li><li>Analysts manually read, interpret, and extract data</li></ul><p>When I joined a FinTech project in <strong>May 2025</strong>, my first task sounded simple:</p><blockquote><em>“Whenever documents are uploaded to SharePoint, automatically extract key information and store it for testing.”</em></blockquote><p>That single line turned into one of the <strong>most complex and educational systems I’ve built</strong>.</p><p>This blog explains:</p><ul><li><strong>What problem we were solving</strong></li><li><strong>Why naive solutions failed</strong></li><li><strong>How the final system works</strong></li><li><strong>What technologies I chose and why</strong></li><li><strong>How this approach can help any industry</strong></li></ul><h3>The Real Problem (Not the Surface One)</h3><p>At first glance, the problem looked like OCR.</p><p>In reality, it was <strong>document understanding</strong>.</p><p>We weren’t dealing with one or two document types. We had <strong>19+ document categories</strong>, including:</p><ul><li>Identity documents (Passport, Driver’s License)</li><li>Property &amp; legal documents (Title Search, Trust Deed)</li><li>Financial statements (Assets &amp; Liabilities, Loan Statements)</li><li>Compliance checks (PPSR, Bankruptcy, NPII)</li><li>Insurance, valuation, council records</li><li>Government-issued documents from different vendors</li></ul><p>Each document:</p><ul><li>Looked different</li><li>Followed different layouts</li><li>Used different terminology</li><li>Sometimes combined <strong>multiple documents in one PDF</strong></li></ul><p>This is <strong>not</strong> a “train one model and done” problem.</p><h3>What the System Needed to Do</h3><p>Before touching technology, I defined the <strong>non-negotiable requirements</strong>:</p><ol><li>Accept <strong>any file format</strong><br> PDF, DOCX, PPTX, XLSX, PNG, JPEG — real users upload everything.</li><li>Automatically <strong>detect document type</strong><br> Without relying on file names or folders.</li><li><strong>Handle mixed documents</strong><br> Example: Passport + Driver’s License inside the same PDF.</li><li>Extract <strong>structured fields</strong>, not just text.</li><li>Store outputs in a <strong>review-friendly format</strong> (Google Sheets initially).</li><li>Be <strong>extensible</strong> — new document types should not break the system.</li></ol><h3>Prerequisites (What You Need Before Building This)</h3><p>If you want to build something similar, you’ll need:</p><ul><li>Microsoft SharePoint (document source)</li><li>Power Automate (orchestration)</li><li>Azure Document Intelligence</li><li>Azure Functions (for edge cases)</li></ul><p>Basic understanding of:</p><ul><li>OCR vs classification vs extraction</li><li>REST APIs</li><li>JSON handling</li><li>Patience — real documents are messy 😄</li></ul><h3>High-Level Architecture (Conceptual)</h3><p>A document is uploaded to a <strong>SharePoint folder</strong></p><ol><li><strong>Power Automate</strong> detects the upload</li><li>File content is sent to <strong>Azure Document Intelligence</strong></li><li>The system:</li></ol><ul><li>Extracts text (markdown)</li><li>Classifies the document</li></ul><p>Based on classification:</p><ul><li>The document is routed to the correct folder</li><li>Extracted data is saved to <strong>Google Sheets (testing phase).</strong></li><li>Edge cases (multi-doc PDFs) are handled via <strong>Azure Function</strong></li></ul><blockquote><em>This separation of responsibilities is critical</em></blockquote><ul><li>Power Automate = orchestration</li><li>Azure DI = OCR + layout understanding</li><li>Azure Functions = logic that doesn’t fit low-code tools</li></ul><h3>Step 1: Ingesting Documents from SharePoint</h3><p>My very first task was simple but foundational:</p><blockquote><em>“Whenever a file is uploaded to a SharePoint folder, capture it.”</em></blockquote><p>Using <strong>Power Automate</strong>:</p><ul><li>Trigger: <em>When a file is created</em></li><li>Retrieve file metadata</li><li>Retrieve file content using path</li></ul><p>This gave us:</p><ul><li>File name</li><li>File type</li><li>Binary content</li><li>Upload location</li></ul><p>From here, everything else builds.</p><h3>Step 2: Understanding Azure Document Intelligence (Important Lesson)</h3><p>Azure Document Intelligence offers <strong>three approaches</strong>:</p><ol><li><strong>Extract text only</strong> (raw / markdown)</li><li><strong>Classification</strong></li><li><strong>Classification + extraction (trained models)</strong></li></ol><p>Initially, I was asked to try <strong>Option 3</strong>:</p><blockquote><em>Train models using 10 sample documents per type.</em></blockquote><h3>Why This Failed</h3><p>It failed for a simple reason:</p><blockquote><strong><em>Our documents were not consistent.</em></strong></blockquote><p>Examples:</p><ul><li>Title searches from different providers</li><li>Trust deeds written by different law firms</li><li>Financial statements formatted differently every time</li></ul><p>Azure’s trained models work best when:</p><ul><li>Layout is predictable</li><li>Fields appear in consistent locations</li></ul><p>That was <strong>not our reality</strong>.</p><h3>Step 3: The First Big Insight — Stop Treating Documents as Templates</h3><p>Human analysts don’t rely on templates.</p><p>They:</p><ul><li>Read the document</li><li>Understand context</li><li>Decide what information matters</li></ul><p>So I changed approach:</p><h3>New Strategy</h3><ol><li>Use Azure Document Intelligence <strong>only to extract text (markdown)</strong></li><li>Treat the markdown like a document an analyst would read</li><li>Pass it to an <strong>LLM</strong> to:</li></ol><ul><li>Understand document type</li><li>Extract required fields contextually</li></ul><p>This was the turning point.</p><h3>Step 4: Handling Mixed Documents (Passport + License in One PDF)</h3><p>A real-world scenario killed early versions of the system:</p><blockquote><em>A single PDF contained both a passport and a driver’s license.</em></blockquote><p>If we processed it as one document:</p><ul><li>Classification was wrong</li><li>Extraction was wrong</li><li>Downstream logic broke</li></ul><h3>Solution: Per-Page Classification + Splitting</h3><p>I introduced <strong>Azure Functions</strong> with:</p><ul><li>Azure Document Intelligence classification (split=&quot;auto&quot;)</li><li>PyMuPDF (fitz) to split PDFs page-by-page</li></ul><p>Conceptually:</p><ol><li>Classify each page</li><li>Split the PDF</li><li>Route each page to its correct document type</li></ol><p>Now:</p><ul><li>Page 1 → Passport folder</li><li>Page 2 → Driver’s License folder</li></ul><p>This single fix removed <strong>a huge class of errors</strong>.</p><h3>Step 5: Universal Classification &amp; Extraction (The Scalable Way)</h3><p>Eventually, I removed DI-based classification entirely.</p><p>Instead:</p><ol><li>Extract markdown from <strong>any document</strong></li><li>Send markdown to an LLM with a <strong>universal prompt</strong></li></ol><p>Ask:</p><ul><li>What document type is this?</li><li>Extract fields according to that type</li></ul><p>Return structured JSON</p><h3>Why This Works Better</h3><ul><li>No dependency on layout</li><li>New document types require only prompt updates</li><li>Mimics how a real analyst works</li></ul><p>After testing multiple models:</p><ul><li>Mistral → cheaper, weaker context</li><li>GPT-4.1 mini → good but limited</li><li><strong>GPT-4o</strong> → best balance of cost, context, accuracy</li></ul><h3>Step 6: Saving Results for Testing (Google Sheets)</h3><p>Before touching production systems, everything was written to <strong>Google Sheets</strong>:</p><ul><li>One sheet per document type</li><li>One row per document</li><li>Easy for business teams to validate</li></ul><p>This created:</p><ul><li>Trust in the system</li><li>Clear feedback loops</li><li>Faster iteration on prompts</li></ul><h3>What This System Solves (Beyond FinTech)</h3><p>Although built for FinTech, this approach applies to:</p><ul><li>Insurance claims</li><li>Healthcare records</li><li>Legal document review</li><li>Government compliance</li><li>KYC &amp; onboarding systems</li><li>Real estate platforms</li></ul><p>Anywhere humans read documents — this system can assist or replace that effort.</p><h3>Key Lessons I Learned</h3><ol><li><strong>OCR is easy. Understanding is hard.</strong></li><li>Template-based extraction fails in real life.</li><li>Hybrid systems (OCR + LLM) outperform single-tool solutions.</li><li>Low-code tools are powerful — but only with clear boundaries.</li><li>Prompt engineering is now a core engineering skill.</li></ol><h3>What’s Next (Part 2)</h3><p>This blog covered <strong>Part 1</strong>:</p><blockquote><em>Automated ingestion, classification, and extraction.</em></blockquote><p>In the next blog, I’ll cover:</p><ul><li>Integrating this pipeline with <strong>Zoho Creator &amp; CRM</strong></li><li>Handling deal-level routing</li><li>Generating legal documents (ILOO, Credit Committee, SFA)</li><li>Why Docxtemplater saved a 180-page document project</li></ul><h3>Final Thought</h3><p>I didn’t just build a pipeline.</p><p>I learned <strong>how systems fail in the real world</strong> — and how to design for that failure.</p><p>If you’re working on document automation and feel stuck:</p><blockquote><em>You’re not doing it wrong — the problem is harder than it looks.</em></blockquote><h3>👋 If this helped you</h3><p>Follow me — I’m documenting everything I build, <strong>end-to-end</strong>, with honesty and depth.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26118596c303" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>