Yes, Office Scripts is the right approach here since you can't use Encodian or similar connectors.
Here's the confirmed working pattern:
1. In Power Automate, get the file from SharePoint/OneDrive using Get file content
2. Pass the file to an Excel Online (Business) action with Run script, using an Office Script to perform the find and replace
3. Save the result back
Wait though, Office Scripts runs inside Excel, not Word. For Word .docx files specifically, the equivalent is Word Online with a Run script action, but Word Online Office Scripts support is more limited than Excel.
The more reliable approach for .docx without third-party connectors:
1. Use the Word Online (Business) connector action Populate a Microsoft Word template. This replaces placeholder tokens you define in the template with dynamic values. If you can modify your 200 documents to use {{placeholder}} tokens, this is clean and preserves formatting.
2. For true find-and-replace on existing .docx files without modifying the source: use an HTTP action to call the Microsoft Graph API's Word find-and-replace endpoint. Graph supports search and replace operations on Word files stored in SharePoint/OneDrive:
Actually for Word specifically the confirmed Graph API approach is via the OneDrive/SharePoint File Open Session + the Word REST API.
Given the 200+ file constraint, what's the nature of the replacements are they the same substitutions across all files, or different per file? That affects which approach is most practical.
Best regards,
Valantis
✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.
❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).
🏷️ For follow-ups @Valantis.
📝 https://valantisond365.com/