Summarise a document with Power Automate

Complete guide, demonstrating how to summarise Office Documents using Power Automate.

Objective

In this example we’ll be achieving the following objective with a fictional organisation named “10docs Ltd”, a large retailer.

Produce a summary of any document saved into a SharePoint Document Library which contains the documentation that supports a Board Meeting. The summaries will be sent around to all board members in advance of the meeting.

The email should look something like this:

Setup

Power Automate is a growing platform, with an enormous number of first and third party connectors. Tendocs works with them all. To keep it simple, this example uses the following connectors:

  1. SharePoint for Document storage

  2. Tendocs for summarising the documents

  3. Outlook for sending the email

If you need any help along the way, feel free to reach out to the support team.

Assets

So you can test this yourself, exactly as described here, you can download copies of the sample documents used. Then, to get started, all you need is a SharePoint site with a Document Library where you can upload them.

Build

Preparing the basics

  1. Create a new Document Library in a SharePoint Team Site.

  2. Open the Document Library, and then add a new multiline column called "Summary"

Create the Flow

  1. Then go to the Power Automate home page.

  2. Create a new Flow “Instant Cloud Flow”, and then complete as follows.

  1. To the Flow add the "Initialize Variable" action. This will hold each of our summaries.

  1. Add a "Get Files (Properties Only) action. This will retrieve all the documents in the document library.

  1. In the next step we will retrieve each file from the Document Library using the "Get File Contents" action. When you select the identifier from the earlier step, Power Automate will automatically add a For Each loop.

  1. Once we have the file contents, we can send it off to Tendocs for a summary. Add in the Tendocs Summary action.

  1. We are going to now add the summary to the variable we created earlier. Add in the "Append Array to Variable" action. This step does require some basic JSON formatting of the content.

  1. The loop will create the array we need, next we need to format it appropriately for inclusion in an email. We can do that with the "Create HTML Table" action.

  1. The final step is the email. Outlook provides a "Send an Email" action. This has all the options you need for sending the email to all the board members. Fill out the "To" and "Subject" fields. While we have a HTML Table ready to add to the body, to ensure the links work we need a little tweak. Add the following function to an expression block:

replace(replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>'), '&#39;', '"')

Running the new Flow to create your document

All the pieces are now in place, all that is left is to test the new flow.

  1. After saving the Flow, click on the “Test” button, select “Manually” for the trigger, and then click “OK”. You may be prompted to check or create connections, where you can “Continue” and then “Run Flow”.

  2. After a short period of time, the Flow should complete successfully, and you will find an email sitting in you inbox that looks like this:

Extra Feature

In an earlier step we added a new Column to the SharePoint Document Library called "Summary". We can add the summary of each document into that column by adding an "Update File Properties" action as follows:

The Final Result

The final result is an email containing a summary of all the documents, and a document library that contains an automatically generated summary of each document.

This is just a start, and you can add additional features to do things like:

  1. Automatically generating the summary anytime a document is added to the library by changing the Flow trigger.

  2. Run the Flow on a schedule, so that the board meeting email is automatically generated before board meetings, and include any documents added since the last meeting.

Last updated