I was recently asked by a customer if functionality existed to display the estimated read time of content on modern SharePoint pages. This is something they had as part of the requirements for their new SharePoint modern Intranet.
A quick check on the roadmap and a discussion internally confirmed that this isn’t available out of the box yet, at least not for pages anyway. There is ‘Time to read’ functionality available for Office files though –
Microsoft 365 is the smartest place to store your content | Microsoft 365 Blog. It seems something is coming for news posts, as indicated here –
Microsoft SharePoint News: What’s New & What’s Coming – YouTube but it doesn’t mention site pages so we’ll see!
I was confident that this functionality could easily be built with a Power Automate flow, a new column in the ‘Site Pages’ library of a given site and the ‘Page properties’ Web Part to display it on the page.
Fast forward 10 minutes later and I had a fully working solution leveraging Power Automate which was extremely easy to build! Read on to find out how to implement this yourself.
The flow I created is very simple and at a high level, does the following:
- Runs when files (pages in this case) are created/modified in the Site Pages library.
- Retrieves the page content using the SharePoint REST API (Send HTTP request to SharePoint action).
- Converts the page content (returned as HTML) to plain text.
- Splits the content by words and creates an array.
- Calculates the length of the array (number of words).
- Calculates the reading time based on an assumption that the average adult reads around 200 words a minute. This formula is hardcoded and can easily be changed. There is the potential to integrate with a 3rd party REST API/service here if you want to produce a more accurate estimate.
- Updates the value of a column (‘Time to Read’) with the output of the reading time calculation.
Download the flow here – https://aka.ms/spotimetoread
So, here’s how to build it:
- Add a new column to your ‘Site Pages’ library –
Internal name: TimeToRead
Display name: Time to Read
Column time: SLOT
- Create a new page to use as a template OR edit an existing template.
- Add a ‘Page properties’ Web part and configure it to show the ‘Time to Read’ property.
- Save your page as a template/update your existing page template.
- Download the flow package from the link above.
- Import the flow into your environment and connect the data connections.
- Open the flow in edit mode.
- Update the trigger ‘Site Address’ to the URL of your SharePoint site.
- Update the ‘SiteURL’ variable value to the URL of your SharePoint site.
- Save and turn on the flow.
- Create a new page (or modify an existing page that uses your template), add some text Web Parts with text in them and save/publish the page.
- Wait for the flow to run, refresh your page and watch the Time to Read appear! 😎
It’s worth noting that if you need this functionality in other SharePoint sites then you will need to duplicate the flow (one per site/site pages library).
You may however be able to leverage Kevin McDonnell’s (@kevmcdonk) awesome ‘CrossSiteApprovals’ solution on GitHub –
kevmcdonk/CrossSiteApprovals: For when you would like to have a single Flow approving content from across multiple SharePoint sites. (github.com). with some modifications to deploy this flow across multiple sites.
I hope this solution is useful and if you extend it in any way then please do share your updates 🙂