wordDocReplacer Step
Description:
This step replaces the Word document with the variables and globals.
Inputs
- templateName – Choose the desired Report Template
- outputFileName - Name of the output file
- varName - Variable/Global to hold the output file path
Returns
- True – step executed successfully
- False – step failed to execute
Usage:

Example:
Let’s build and execute the “wordDocReplacerDef” example.
- Create a new process definition called “wordDocReplacerDef” and open the definition in designer mode.
- Drag an “updateVariablesWithSQL, wordDocReplacer” step to the canvas.
- Define a variable or a global to store the SQL column values.
- Connect the dots between the “Start” step and other steps, as shown above.
- Click the "updateVariablesWithSQL" step to configure its "Required" properties. Provide a name for the step. Select the Connection String from the drop-down list. Provide the SQL Select statement. Click the button to assign the SQL column values to the process variables or globals. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the button to assign the SQL column values to the process variables or globals. A pop-up window is displayed for configuration. Click the Add Row button to insert a blank row. As shown below, provide the SQL column names and map them to the process variables or globals. Click the Save button.

- Open Microsoft Word and prepare a docx template file, as shown below. The template file includes the process variables or globals, which are replaced with actual values when the document is created during the process instance. Provide a name and save the template as a .docx file in your local folder.

- Click the "WordDocReplacer" step to configure its "Required" properties. Provide a name for the step. Click the file icon and upload the DOCX report template file. Provide a variable or a global to store the output file path. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the "WordDocReplacer" step to configure its "Optional" properties. Provide a name for the output docx file. Click the Save button.

- The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

- Save the process definition, create a new instance, and then execute it. The process instance is completed without any human intervention.

- Render the process instance. Click the “WordDocReplacer” process step to view the properties.

- The step should generate a DOCX file using the variables or global values provided during runtime. The variable stores the path to the PDF file name, as shown below.

- Use the AppURI to the output file path and download the DOC file. The Word document is replaced with the variable values during the process instance.

Definition Sample:
You may download the sample definition(s) from the link here and later import them (drag-and-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
Note: Please verify and complete the process steps for any missing configurations, such as file path references and database connections, after import. Then, save the definition to confirm the changes.
Click here to download the sample file.