Importing Word Documents
To streamline the process of adding and maintaining Word document content in Logicdialog's knowledge base, we use Microsoft Power Automate. This setup allows us to dynamically import content from Word documents and keep it synchronised with updates or deletions in the source files.
Overview
Key Flows
File Created or Edited: Triggers when a Word document is created or modified. The flow fetches the updated content and sends it to Logicdialog.
File Deleted: Triggers when a Word document is deleted. The flow ensures that the corresponding knowledge in Logicdialog is removed to avoid outdated responses.
Setting Up the Flows
Prerequisites
Access to Microsoft Power Automate.
A shared folder or document repository (e.g., SharePoint, OneDrive) where Word documents are stored.
Note that in the information below we'll refer to <rootURL>
which is a parameter specific to each client. Logicdialog will provide this to you upon request.
1. Flow for File Created or Edited
Purpose
When a Word document is created or updated, its content is sent to Logicdialog via an HTTP request to update the knowledge base.
Steps
Trigger: When a file is created or modified
Use the "When a file is created or modified (properties only)" trigger.
Specify the document repository or folder to monitor (e.g., SharePoint or OneDrive).
Action: Get file content
Add the "Get file content" action to retrieve the contents of the Word document.
Use dynamic content to pass the file identifier from the trigger to this action.
Action: Send HTTP request to Logicdialog
Add the "HTTP" action.
Configure the request as follows:
Method: POST
URL:
<rootURL>/import?import?filename=@{outputs('Get_file_metadata')?['body/Name']}"
Headers:
Content-Type:
application/json
Authorization:
Bearer <Your-API-Key>
Body:
{ "filename": "@outputs('Get_file_metadata')?['body/Name']", "file": "@body('Get_file_content')" }
Test and Save the Flow
Save the flow and test it by creating or editing a file in the monitored folder.
Verify that the content is successfully imported into Logicdialog.

2. Flow for File Deleted
Purpose
When a Word document is deleted, the corresponding knowledge entry in Logicdialog is removed to avoid outdated responses.
Steps
Trigger: When a file is deleted
Use the "When a file is deleted" trigger.
Specify the document repository or folder to monitor.
Action: Send HTTP request to Logicdialog
Add the "HTTP" action.
Configure the request as follows:
Method: DELETE
URL:
<rootURL>/delete?filename=@{triggerOutputs()?['body/FileNameWithExtension']}
Headers:
Content-Type:
application/json
Authorization:
Bearer <Your-API-Key>
Test and Save the Flow
Save the flow and test it by deleting a file in the monitored folder.
Verify that the corresponding entry is removed from Logicdialog.

Please note that for this process to work, the owner of the flow in Microsoft Power Automate needs to be an owner of the SharePoint site where the files are located as well.
Last updated