Search Results for

    Show / Hide Table of Contents

    Syntex and Chat GPT Integration App

    In this scenario you will find a Power Platform sample document management solution that uses Microsoft Syntex Structured Document Processing and Open AI Chat GPT integration.

    In this Power App you can upload a new invoice and after Syntex classification you can ask for more details with about all items extracted from your invoice using Open AI.

    Deploy today to your tenant and see a great example of the art of the possible with Power Platform, Microsoft Syntex and Open AI.

    Deployment Instruction

    Prerequisites

    • A Power Platform Environment with Dataverse and with AI Builder credit You can enable a trial for AI Builder at this link

    https://powerapps.microsoft.com/en-us/ai-builder/

    image
    • A OpenAI free subscription with a valid key (in the format "Bearer XXXkeyXXX") for Power Platform OpenAI Independent connector If you don't have this key register your free account at https://platform.openai.com/overview

    image

    Click on "View API Keys"

    image

    Then select "Create new secret key" and take a note of the secret key generated. You will need this later.

    Create a SharePoint Document Library in your Site

    In your Team or Communication SharePoint site you need to create a document library. Remember this name because you must set an Environment Variable with this document library name.

    image

    Create a Layout Method Model in Syntex

    Open your Content Center site and create a new "Layout Model" image

    Click "Next"

    image

    Select a name and click "Create"

    image

    Start to create all the necessary fields

    image
    1. Invoice Number image

    2. Invoice To image

    3. Invoice Date image

    4. Invoice Total image

    5. Invoice Tax image

    6. Vendor image

    When you have finished creating the above fields - this is what the screen will look like

    image

    Now you need to create a table field for the invoice details For the new field you need to select the "+ Add" dropdown and then select "Table"

    image

    Change the table new using "Details" and add three columns with name:

    • Item
    • Quantity
    • Amount
    image

    Click "Next"

    image

    Start to create all the necessary collections

    Click on "New Collection"

    image

    Rename the first collection with name "Adatum"

    image

    Add 5 "Adatum" invoices present in the Train subfolder under "Adatum"

    image

    Select "Upload 5 documents"

    image

    When the upload process finished press "Done"

    image

    Create now a new collection "Contoso"

    image

    Add 5 "Contoso" invoices present in the Train subfolder under "Contoso"

    image

    Select "Upload 5 documents"

    image

    When the upload process has finished press "Done"

    image

    Press "Next" and start to tag all documents

    Tag Documents

    Click in the first "Adatum" collection

    image

    Identify the Invoice Number and select the corresponding field

    image

    Repeat this step for: Invoice To

    image

    Invoice Date

    image

    Invoice Total

    image

    Invoice Tax

    image

    Vendor

    image

    Now you need to identify the details table in the form as displayed in this picture

    image

    On the right select "Advanced tagging mode"

    image

    This view the table on the right section

    image

    In the first row select the description.... and the description will be displayed on the table on the right under the item column

    image

    The same for quantity...

    image

    Also for line total that will be displayed under Amount

    image

    Repeat these steps for all other rows and click "Done"

    image

    Go to the second document and repeat all steps above

    image

    The same for all other 3 Adatum invoices...

    image

    Now you can start to tag all "Contoso invoices"

    1. Invoice Number image

    2. Invoice To image

    3. Vendor image

    4. Invoice Total image

    5. Invoice Tax image

    6. Invoice Date image

    Now you need to identify the details table in the form as displayed in this picture

    image

    Select the description to insert the value in the Item column

    image

    The same for quantity

    image

    The same for amount

    image

    Repeat all steps for other rows

    image

    Click "Done" to switch to the second document... Repeat all steps above

    image

    The same for all other 3 documents... When you finished click "Next" to review the model

    image

    Now Train the model by clicking the Train button...

    image

    Your Model is training with the be displayed

    image

    In the Content Center wait until the training is finished...

    image

    Click "Publish" to publish the model

    image

    Apply Model to a SharePoint Document Library

    Choose the document library previously created to associate the newly created model to.

    image image

    Create a related list for save all details line

    image image

    Select your preferred view

    image

    Get SharePoint Site ID and Invoice Document library ID

    In this sample for invoice upload, the Power App use Graph API. For this is necessary identify the SharePoint site ID and document library ID

    Open graph explorer at https://developer.microsoft.com/en-us/graph/graph-explorer and insert your credential (remember to use the correct consent for read sites properties and upload file in a document library)

    Use this call: https://graph.microsoft.com/v1.0/sites/<>.sharepoint.com:/<> Es: https://graph.microsoft.com/v1.0/sites/tenantXXX.sharepoint.com:/sites/DemoSyntex

    This is the result

    image

    The second part of id is your site id

    Use this call https://graph.microsoft.com/v1.0/sites/<>/drives to take the document library id

    Copy these values into a text editor or somewhere safe, will be necessary to set an environment variables value

    Install Power Platform Solution

    Open your Power Platform Environment where you want to install the solution SyntexChatGPTIntegration_1_0_0_5.zip Click on "Import Solution"

    image image

    Leave all default settings and click "Next"

    image

    Select the correct connections of SharePoint, Office 365 Groups and OpenAI Independent connector. If these connection don't exist create them.

    image

    Click "Import" Set the correct value for all necessary environment variables

    image

    Wait until the import process has finished

    image

    Once finished, open the canvas app "Manage Invoices Syntex ChatGPT"

    image ### Test the app

    Click on "Attach file" and select Adatum test invoice

    image Click the "Upload" button and once the file has uploaded, use refresh button on the App to retrieve the document detail image

    Wait until the Syntex model has analyzed your document

    image

    You now may want to find out more information regarding an item i.e. "Safe pool alarm".... you may ask Clippy to search Open AI

    image

    This would then be the response....

    image
    Back to top Syntex Samples
    Generated by DocFX with Material UI