Last December, we released the ‘Get Tracked Changes‘ Power Automate action, which obtains all of the tracked changes data (comments and changes) for the Microsoft Word document provided, returning the data as JSON formatted strings.
For this post, we’ll provide a basic guide for using the ‘Get Tracked Changes‘ Power Automate action to obtain tracked changes data from a Microsoft Word document covering both the creation of a summary document and manually handling the tracked changes and comments data.
1. Create a new ‘Automated cloud flow.‘
1.a. Flow name: Provide a name for your flow
1.b. Trigger: Select the ‘When an item of a file is modified‘ SharePoint trigger action
1.c. Click ‘Create‘
2. Configure the ‘When a file is created in a folder‘ SharePoint trigger action as required.
3. Add a trigger condition to the ‘When an item of a file is modified‘ to ensure the flow is only triggered when a Microsoft Word document (docx) is modified. We’ll add this trigger condition: @endswith(triggerOutputs()?[‘headers/x-ms-file-name’], ‘docx’)
5.a. File Content: Select the ‘File Content‘ property provided by the ‘Get file content‘ SharePoint action
At this stage, it’s worth testing the flow to verify that your document has tracked changes and comments. For example, the test document I have configured contains an addition, deletion and comment:
The Encodian ‘Get Tracked Changes‘ action returns the changes and comments as two JSON formatted strings:
The JSON data structure for changes is depicted below:
The JSON data structure for comments is depicted below:
Note both return datasets are an array, i.e. one or more comments. There are loads of options for handling the data. The following examples are detailed below:
Create a Summary Document and attach it to an Email
The first option is to use the Encodian ‘Populate Word Document‘ action to create a summary document using the JSON data values returned by the Encodian ‘Get Tracked Changes‘ action.
To create the document which can pass the JSON data provided by the Encodian ‘Get Tracked Changes‘ action to the Encodian ‘Populate Word Document‘ as it can natively add this data type as a repeating section, table, bulleted list or paragraph as document here:
8. Add the SharePoint ‘Get file content‘ action and configure to obtain the ‘File Content‘ of the Word template file from the location specified in step #7
9.a. File Content: Select the ‘File Content‘ property provided by the SharePoint ‘Get file content‘ action
9.b. Document Data: Select the ‘Data‘ property provided by the ‘Initialize variable‘ action
10. Add the ‘Send an email (v2)‘ action and configure as required
10.a Attachments Name – 1: Select the ‘Filename‘ property provided by the Encodian ‘Populate Word Document‘ action
10.a Attachments Content – 1: Select the ‘File Content‘ property provided by the Encodian ‘Populate Word Document‘ action
Upon testing your flow, the email sent should contain a word document providing a summary of the tracked changes and comments contained within the document.
Parse Tracked Changes and Send as an Email
Commencing from step #5; 6. Test your flow to verify that tracked changes and comments data is returned by the Encodian ‘Get Tracked Changes‘ action
7. Add a ‘Parse JSON‘ action 7.a. Content: Select the ‘JSON – Tracked Changes‘ property provided by the Encodian ‘Get Tracked Changes‘ action
7.b. Generate the schema following the animated guide below. The sample value should be copied from the ‘JSON – Tracked Changes‘ property value from step #6
8. Add the ‘Send an email (v2)‘ action and configure as per the following animated guide below:
An email will be sent for each change detected within the document. You can perform the same steps to access comments data.
Finally…
We hope this post provides valuable information on obtaining tracked changes and comments from a Microsoft Word document and examples of using the data within Power Automate.
Please share any feedback or comments – all are welcome 🙂
We recently released the ‘Secure Word Document’ action which can be used to secure (also known as protect) a Microsoft Document covering all the typical file formats (DOCX, DOC, DOTX, DOT, DOCM, DOTM and RTF). The action provides the following options for securing / protecting the Word document controlled by the ‘Protection Type‘ option:
AllowComments – Users are permitted to add / modify comments only
AllowFormFields – Users can enter data into form fields only
AllowRevisions – Users can add revision marks only
ReadOnly – Users are blocked from applying any modifications to the file
NoProtection – The document is not protected
For this post we’ll provide two very basic examples for using the ‘Secure Word Document’ action to add protection and remove protection from the Word document. **We’ve also included a bonus video showing how you can quickly use Encodian Trigr to deploy the flow used for these examples to your entire SharePoint environment!
Protect a Microsoft Word Document with Power Automate
For this basic example we’re simply going to create a manually invoked Power Automate Flow, secure the selected Word Document and save to OneDrive, simple!
3.a Flow name: Enter a relevant name for your flow
3.b Trigger: Select the ‘Manually trigger a flow‘ trigger action
3.c Click ‘Create‘
4. Select the ‘Manually trigger a flow‘ trigger action, click ‘Add an input‘
5. Select ‘File‘
6.Underneath the ‘Manually trigger a flow‘ trigger action, add the Encodian ‘Secure Word Document’ action:
6.a. Filename: Manually enter a value, in a real world scenario you would obtain the filename from the file properties.
6.b. File Content: Select the ‘File Content‘ property provided by the ‘Manually trigger a flow‘ trigger action
6.c. Password: Enter the password which will be used to protect and remove protection from the document
6.d. Protection Type: Select the ‘ReadOnly‘ option
7. Underneath the Encodian ‘Secure Word Document’ action, add the OneDrive ‘Create File‘ action
7.a. Folder Path: Select the location within OneDrive to save the protected Word document
7.b. File Name: Select the ‘Filename‘ property provided by the Encodian ‘Secure Word Document’ action
7.c. File Content: Select the ‘File Content’ property provided by the Encodian ‘Secure Word Document’ action
That’s it all done! The Power Automate flow will now secure the selected document and save you the configured OneDrive location! Your flow should look similar to the following:
After executing the flow, you will see the secured Microsoft word document added to your OneDrive:
And upon opening the file you’ll be able to verify the protection level applied to the document:
Remove protection from a Microsoft Word Document with Power Automate
Following on from adding protection (securing) a Microsoft Word Document, this section outlines how to remove protection.
2. Update the Encodian ‘Secure Word Document’ action as follows: 2.a. Protection Type: Select the ‘NoProtection‘ option
That’s it :)! The flow has now been configured to remove protection from the selection Microsoft Word Document!
Deploy the Power Automate Flow to all SharePoint Sites and Document Libraries
What if you wanted to deploy the Flow you have created to secure / protect Microsoft Word documents to all SharePoint libraries? This can be very quickly achieved using Encodian Trigr, checkout the following video guide 🙂
Finally…
We hope this post provides a helpful example of how you secure Microsoft Word documents using the Encodian ‘Secure Word Document’ action and Microsoft Power Automate.
Please share any feedback or comments – all are welcome 🙂
We’re pleased to announce a new Power Automate action, ‘Sign PDF‘ for Encodian ‘Flowr‘, which provides the capability to digitally sign a PDF document in Power Automate with two different options. The ‘Standard‘ option uses Encodian’s ‘Adobe Approved Trust List‘ certificate. Thus, a signed document will appear as an approved signature with long-term validation enabled (the signature image is optional).
The ‘Custom‘ option allows you to provide a custom certificate in PFX format, which is used to sign the document. The validity of the signature will depend on the certificate provided
Sign a PDF Document after approval in Power Automate
To provide an example of using the ‘Sign PDF‘ action, we’ll cover a very common scenario; after a document has been approved via a Power Automate approval process, we’ll create a signed PDF rendition of the selected document.
Consider the following simple flow associated with a specific SharePoint library. The user can select a file in SharePoint and submit it for approval to the specified ‘Approver’. The approval outcome is then emailed to the user who started the flow… simple!
We’re now going to extend this flow to convert the selected document to PDF and add a digital signature using the ‘Sign PDF‘ action before adding the signed PDF document to the SharePoint library!
1. Within the ‘If yes‘ branch, add the SharePoint ‘Get File Content‘ action
1.a Site Address: Set as per the ‘Site Address‘ value for the ‘For a selected file‘ trigger actions ‘Site Address‘ value
1.b. File identifier: Select the ‘Identifier‘ property provided by the ‘Get file properties‘ action
2. Move the ‘Send and email (V2) – Approved‘ action beneath the SharePoint ‘Get File Content‘ action.
3. Underneath the SharePoint ‘Get File Content‘ action, add the Encodian ‘Convert to PDF‘ action
3.a. Filename: Select the ‘File name with extension‘ property provided by the ‘Get file properties‘ action
3.b. File Content: Select the ‘File Content‘ property provided by the ‘Get file content‘ action
3.c. PDF Filename: Select the ‘File name with extension‘ property provided by the ‘Get file properties‘ action
We’re now going to add the ‘Sign PDF‘ action by selecting the ‘Standard‘ certificate type. This uses Encodian’s ‘Adobe Approved Trust List‘ certificate. Thus a signed document will appear as an approved signature with long-term validation enabled.
The ‘Sign PDF‘ action advanced options allow you to configure whether an image signature should be visible, also providing the opportunity to provide your signature image. For example, you could pass an image generated from a PowerApp ‘Pen input’ control and use this as the signature image!
4. Underneath the SharePoint ‘Convert to PDF‘ action, add the Encodian ‘Sign PDF‘ action
4.a. Certificate Type: Select ‘Standard‘
4.b. File Content: Select the ‘File Content‘ property provided by the ‘Convert to PDF‘ action
5. Underneath the Encodian ‘Sign PDF‘ action, add the SharePoint ‘Create file‘ action
5.a. Site Address: Set as per the ‘Site Address‘ value for the ‘For a selected file‘ trigger actions ‘Site Address‘ value
5.b. Folder Path: Select the ‘Folder path‘ property provided by the ‘Get file properties‘ action
5.c. File Name: Select the ‘Filename‘ property provided by the Encodian ‘Sign PDF‘ action
5.d. File Content: Select the ‘File Content’ property provided by the Encodian ‘Sign PDF‘ action
That’s it all done! The Power Automate flow will now create a digitally signed PDF from the approved document! Your revised flow should look similar to the following:
After testing the flow, you should see the signed PDF document added to your SharePoint library:
Open the PDF within Adobe Acrobat (or equivalent) to view the signature:
An ever-present question we’re seeing via our support service and from within the Microsoft Power Automate community: How can I insert HTML data into a Microsoft Word Document using Power Automate? It’s pretty simple to use our ‘Populate Word Document‘ action, and this post will provide an example of how to use this feature.
Add SharePoint-rich text data (HTML) to a Word Document
I’m not going to use a real-world scenario as such for this example, as we’ll focus on the mechanics of adding HTML data into a word document. For this basic scenario, I will obtain HTML data from a SharePoint list item column which contains rich text data, as this is an everyday use case. For this demo, I have configured a word document as follows:
I have created a SharePoint list item which contains the following data:
And I have made the following super simple flow:
I’m passing in the template word file when the flow is manually triggered. We then retrieve the item from SharePoint. The file is passed to the ‘Populate Word Document‘ action along with the value of the ‘HTML Example‘ column bounded by a basic JSON structure. We then add the populated document to Onedrive… simple! 🙂
When I execute the flow, it fails with the following error: A error occurred parsing the JSON document provided: After parsing a value, an unexpected character was encountered. This is because the ‘Document Data‘ property has received invalid JSON caused by unescaped double quotes.
HTML markup contains lots of double quotes (also known as speech marks), and if you want to insert HTML data into JSON, then you must escape the double quotes, which is luckily relatively simple and documented in detail here: Escape double quotes in JSON using Power Automate
To resolve this issue I need to wrap the ‘HTML Example‘ property value in the following expression: replace(<dynamicDataHere>,'”‘,’\”‘)
Now I can re-execute the flow successfully:
And validate that the HTML data has been added to the document correctly:
Finally…
We hope this post provides a helpful example of how to pass HTML data obtained from a PowerApp, website, SharePoint item, etc. and then add the HTML data into a Word document (which could also be converted to PDF!)
Please share any feedback or comments – all are welcome 🙂
Now, these actions still provide viable options for adding data to PDF / Word documents. Still, there is a fourth option which we’d suggest as the optimal solution for generating documents and populating them with data. The ‘Populate Word Document‘ action provides a powerful solution which handles conditional logic, repeating sections, table data, lists, HTML, document insertion, charts and much more! Please refer to the syntax documentation for further details: Template Syntax for Populate Word Document. We’ve previously posted example solutions which use the ‘Populate Word Document‘ action, which is well worth reviewing:
1. File Content: The Microsoft Word Document (DOCX) to populate 2. Document Data: The JSON data to populate the document with
The Microsoft word document should be configured with tokens which will be replaced at runtime with the JSON data provided. An example of a token:
An example of a corresponding JSON data structure:
{ "companyName":"Encodian" }
Note the name of the JSON node matches the value of the token: companyName
Here is a very simple Flow which will populate the manually provided document and save the output to OneDrive:
The resulting document:
Create a document using data from a PowerApp
Consider this common scenario; We have a PowerApp which collates data for a business purpose, and once the data is collated, we need to create a document rendition of that data. I have set up a very simple PowerApp for conducting an ‘Employee Review’ to demonstrate this. I will pass the data to Power Automate to create a document representing the data captured during the review.
This is the super simple PowerApp, noting I have just added controls to a screen as opposed to using a form:
Follow these simple steps to update the PowerApp to pass data to a Power Automate flow.
1. Click ‘Power Automate‘ > ‘Create new flow.‘
2. Click ‘Create from blank.‘
3. Set a name for your Flow
4. Add the SharePoint ‘Get File Content‘ action or related action to obtain the ‘File Content’ of the Word template file.
The word template for this demo has been configured as follows:
5.a. File Content: Select the ‘File Content‘ property provided by the SharePoint ‘Get file content‘ action
5.b. Document Data: Select ‘Ask in PowerApps‘
We’ll configure the PowerApp to provide data as a JSON string. However, the pen input control within the example PowerApp will give the image as a dataUri value and not a base64 string.
The Encodian action only expects a base64 value; therefore, we can add this simple replace() expression to omit the unwanted dataUri details.
Additionally, the PowerApp will return the data as an array, but we only need access to a single property (the JSON string), so therefor we need to use the following complete expression configuration to replace the unwanted data values and obtain the first item within the array: first(json(replace(<PowerAppProperty>,’data:image/png;base64,’,”)))
Update the flow as follows:
We now need to do something with the generated file. For this demo, we’ll save it to SharePoint. You may wish to parse the JSON value provided by PowerApp so that you can use this data within the flow. I’ve just hard-coded the filename value for demo purposes.
6. Add a SharePoint ‘Create file‘ action
6.a. Site Address: Set to the value of the SharePoint site, which contains the target document library
6.b. Folder Path: Set to the value of the target SharePoint folder
6.c. File Name: Enter the required value
6.d. File Content: Select the ‘File Content‘ property from the ‘Populate Word‘ action
7. Save and close the flow
8. Within the PowerApp, select your submit button, and click ‘Advanced.‘
9. Within the ‘OnSelect’ property, add the following configuration updating as required for your application:
This configuration collates data within the form into a collection so we can pass it to the Power Automate flow.
10. Underneath the previously added configuration, append the following: ‘<autoSelect>‘.Run(JSON(colData, IncludeBinaryData));
11. Your PowerApp is ready for testing. On clicking the ‘Submit’ button, data will be sent to the Power Automate flow.
12. The Power Automate flow will be invoked, and the JSON data will be passed to the Encodian action
13. The document will be available from the configured location.
If a PDF rendition is required, update your flow to use the Encodian ‘Convert Word‘ action as follows:
Finally…
We hope this post provides valuable information on how to build documents passing dynamic data, specifically how to do this using data collated via a PowerApp.
Please share any feedback or comments – all are welcome 🙂
So, you have created a Power Automate flow linked to a document library in SharePoint Online, and you now need to make this flow available across multiple SharePoint libraries.
We’ve all been here, and the options are limited. When you create a Power Automate flow linked to a document library in SharePoint Online, it is hard-coded to that document library. You’ll need to create a replicate flow for all other libraries you would like to use the flow… possible for a few libraries but not at scale, and it’s always a bad solution to create replicas!
For this post, we’re going to show you have you take your existing flow and re-configure it to be instantly available across all SharePoint Online document libraries using Encodian Trigr!
Consider this simple ‘Approval’ automation which can be launched from a single SharePoint document library:
This ‘Submit for Approval’ automation is only available on this document library and is configured as follows:
As depicted, the simple limitation is that the SharePoint actions are hard-coded to a specific site and document library! Let’s fix this!
Migrate an existing flow to Encodian Trigr
We will update this flow to use Encodian Trigr to make it available across all SharePoint Online document libraries.
1. Delete the ‘For a selected file’ trigger action from your flow
2. Enter ‘Encodian’ within the search box, select the ‘When a user runs a Trigr’ trigger action
3. Set the ‘Title’ and ‘Description’ fields
4. We now need to update the values applied to the SharePoint ‘Get File Properties’ action
4.a. Site Address: Select the ‘Site Address’ property provided by the ‘When a user runs a Trigr’ trigger action
4.b. Library Name: Select the ‘Library/List Name’ property provided by the ‘When a user runs a Trigr’ trigger action
4.c. Id: Select the ‘Item’ property provided by the ‘When a user runs a Trigr’ trigger action
5. Save the changes to your flow
The flow configuration update is complete! We now need to configure Encodian Trigr to make this flow available across all document libraries within our SharePoint Online tenant.
7. Login using the credentials supplied in the ‘Your Encodian Trigr Trial is ready!’ email
8. Select ‘Encodian Trigr’ > ‘Configuration’
9. Click ‘Add Action.’
10. On the ‘Add Action’ form
10.a. Select your Microsoft Flow.
10.b. Update the ‘Title’ and ‘Description’ fields if required
10.c. Add a ‘Run Message’ which will be displayed to the user after the flow has been triggered
10.d. Del-select the ‘Lists’ checkbox in the ‘Appear in’ section. Our flow is document library-specific, so we do not want the action to appear within lists.
10.e. Click ‘Create.’
11. Your ‘Action’ has now been created and will be available across all SharePoint sites
The action can be found via the Encodian Trigr App as below:
Final thoughts…
Hopefully, this post provides a detailed guide on how you can migrate your current Power Automate flows from a single document library, making them available across your entire SharePoint Online tenant with Encodian’ Trigr.’
We hope you’ve found this guide useful; please share any feedback or comments. All are welcome!
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
ARRAffinity
session
ARRAffinity cookie is set by Azure app service, and allows the service to choose the right instance established by a user to deliver subsequent requests made by that user.
ARRAffinitySameSite
session
This cookie is set by Windows Azure cloud, and is used for load balancing to make sure the visitor page requests are routed to the same server in any browsing session.
cookielawinfo-checkbox-advertisement
1 year
Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category .
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
CookieLawInfoConsent
1 year
Records the default button state of the corresponding category & the status of CCPA. It works only in coordination with the primary cookie.
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Cookie
Duration
Description
_ga
2 years
The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
_gat_gtag_UA_107931024_1
1 minute
Set by Google to distinguish users.
_gcl_au
3 months
Provided by Google Tag Manager to experiment advertisement efficiency of websites using their services.
_gid
1 day
Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
CONSENT
2 years
YouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Cookie
Duration
Description
test_cookie
15 minutes
The test_cookie is set by doubleclick.net and is used to determine if the user's browser supports cookies.
VISITOR_INFO1_LIVE
5 months 27 days
A cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.
YSC
session
YSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.
yt-remote-connected-devices
never
YouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
yt-remote-device-id
never
YouTube sets this cookie to store the video preferences of the user using embedded YouTube video.