Generating Invoices Using Excel Templates
This section provides you with the steps to generate an invoice in PDF format using data from an SQL database and an excel document template.
In this video:
- We have two entities: [[Customer]] and [[Item]].
- The [[Customer]] stores information related to customers. This entity is the request entity from which the Document Generator connector will merge entity-sourced dynamic data.
- The [[Customer]] entity has a field named Document of type File. It will store the output document generated by the Document_Generator connector app.
- The [[Customer]] entity also has a field named Product of type Entity List and references the [[Item]] entity.
- In our SQL database, we have an entity named Article that contains article details.
- We have an SQL connector named Article Database that brings items details for invoice generation. It will get information from the Article entity and store it in the [[Item]] entity (Druid entity).
Invoice Generation Procedure
- Create the excel document template to be used for invoice generation. For information on how to create an Excel template, see Creating Excel Templates.
- Import the excel document template into the Druid ChatBot Portal. For more information, see Upload document.
- Create a connection action for invoice document generation. For more information, see Create Action and Add Integration Tasks for Documents Generation.
- Create the flow for invoice generation. In the video, the flow has three steps as follows:
- Get items from the SQL database.
- Generate the invoice document. For more information, see Call the connection action for document generation.
- Deliver document to the chat user.
To see the Document Generator in action, open the chatbot and in the chat enter the utterance you set on the flow. It might take a few seconds until the SQL connector gets data from the SQL database and the Document Generator generates the invoice using the excel document template you provided.