@AdamGill1965
Here are some steps you can incorporate into your Power Automate Flow:
Refresh Content Controls: Add a step in your flow that opens the Word document and updates the content controls (Quick Parts). Unfortunately, Power Automate does not have a built-in action for this. You would typically need to use a custom connector or an Azure Function to run a script that opens the Word document, refreshes all fields, and then saves the document.
Use Word Online Business Connector: If you have access to Word Online (Business) connector, there is an action called “Populate a Microsoft Word template” which allows you to create a Word document from a Word template and populate content controls with dynamic data from your flow. You can then create a document with fresh data pulled from your SharePoint List.
Convert to PDF: Since PDFs are static and won't have the Quick Parts update issues, consider adding a step to convert the Word document to a PDF once it's ready. This can be achieved with the "Convert Word Document to PDF" action in Power Automate. This way, you ensure the receiver views the document content as intended.
Remove Quick Parts Programmatically: If you have the capability, write a custom script (using Azure Functions or Automation Runbooks) that programmatically removes or updates Quick Parts from the Word document. This script can be called from Power Automate using the HTTP action.
Check In/Check Out Document: If you're working with SharePoint document libraries that have versioning and check-in/check-out enabled, make sure to add steps in your flow to check out the document before making changes and check it in afterward.
Manual Trigger to Refresh Data: As a workaround, you could create a manual trigger (button or similar) in your app that the user must press to update the data. This would be a temporary fix and not an automated solution.
Set Document Properties: You may need to add or modify the document properties (metadata) before generating the final document to ensure that all the fields are populated with the correct data.
Here’s a simplified example of what the flow steps could look like:
When a SharePoint list item is modified or created, trigger the flow.
Use the “Get item” action to retrieve the current data from the SharePoint List.
Use the “Populate a Microsoft Word template” action from the Word Online (Business) connector to create your document with the fresh data.
If necessary, add a custom script action to refresh fields or remove Quick Parts.
Convert the Word document to PDF for static content.
Create an email with the PDF attached using the “Send an email (V2)” action.
(Optional) Update the SharePoint list item to reflect the document’s creation and sent status.
Always test your flow thoroughly to ensure that the documents generated have the correct, up-to-date information before being sent out to the end-users.
Kindly mark the solution as accepted if it resolves your issue.
Best Regards
Muhammad Mudassar Mazhar