Doc Replacer

Use this step to replace the Word document with the variables and globals.

Last published at: September 6th, 2025

wordDocReplacer Step

Description:

This step replaces the Word document's 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. Enter the SQL Select statement. Click the button to assign SQL column values to process variables or globals. Click the Save button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description. 

 

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

 

  • Open Microsoft Word and create a .docx template file as shown below. The template includes process variables or globals that 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 to upload the DOCX report template. Specify a variable or global to store the output file path. Click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description. 

 

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

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and 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 execute it. The process instance completes without any human intervention. 

 

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

 

  •  The step should generate a DOCX file using the variables or global values provided at 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 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 the import. Then, save the definition to confirm the changes. 

Click here to download the sample file.