Insert Multiple Text Sections To Word
Description
This action allows you to insert multiple pieces of text into a Word (DOCX) document at specific placeholder locations.
You must provide an existing Word file, which contains placeholder markers defined by a prefix, suffix, and a name (e.g., {{InsertHere}
}).
Input Arguments
Input Argument | Type | Description | Required? | Advanced Option? | Default |
---|---|---|---|---|---|
Existing File Content | File | A Word (DOCX) file to update. If empty, a new document is created. Must be a file – Base64 string is not supported. | ✔️ | ❌ | - |
Placeholder Name - 1 | Text | The text between prefix and suffix where to insert the text, e.g. {{InsertHere}} . | ✔️ | ❌ | - |
Placeholder Text - 1 | Text | Placeholder text | ❌ | ❌ | - |
+ Add new item | Repeating | Add more sections with their own Placeholder Name and Placeholder Text. | ❌ | ❌ | - |
Placeholder Prefix | String | Opening placeholder delimiter e.g. {{InsertHere}} . | ❌ | ✔️ | '{{' |
Placeholder Suffix | String | Closing placeholder delimiter e.g. {{InsertHere}} . | ❌ | ✔️ | '}}' |
Output
Response | Type | Description |
---|---|---|
File response | DOCX | The updated Word file |
File response as string | String | The file content as a string. This can be stored in a variable, saved to Dataverse, or passed to other actions that require the file content in string format. |
MIME type | String | The MIME type of the DOCX file |
Extension | docx | The file extension (always docx) |
Power Automate Examples
Insert Multiple Text Sections To Word
You need to provide the existing Word (DOCX) file containing placeholders (in our case, from the OneDrive action Get file content), specify the placeholder names (without the surrounding braces) in the field Placeholder Name - 1, and enter the text that should replace each placeholder in the field Placeholder Text - 1.
You can add multiple placeholder-text pairs, and optionally define the prefix and suffix used around the placeholders (default is {{
and }}
), but in our case, we use ##
.
Looking for the response to this example? Scroll up to see the Output tab.