Description
This activity replaces words in curly brackets in a Word file with the desired values.
Supported file format - .docx.
Parameters
Path to file
- Set a value: allows you to set a path to a word file manually. Click on the “PICK” button to specify the path.
- Calculate a value: allows you to use a special formula or a special method to specify a file path.
- Save the previous step result: takes the result of the function from the previous workflow step as a file path.
Substitution map
Create a dictionary containing the words to substitute and the substitutions themselves. For example, if a word file contains words {{name}}
and {{surname}}
, which you want to replace with real values, for example, 'Jack' and 'Smith', the substitution map will look like this: {'name': 'Jack', 'surname': 'Smith'}
.
- Calculate a value: allows you to use a special formula or a special method to set a substitution map.
- Save the previous step result: takes the result of the function from the previous workflow step as a substitution map.
New file path
- Set a value: allows you to set a path to a new word file manually. Click on the “PICK” button to specify the path.
- Calculate a value: allows you to use a special formula or a special method to specify a new file path.
- Save the previous step result: takes the result of the function from the previous workflow step as a new file path.
If the "New file path" parameter is not specified, the file from the "Path" parameter will be overwritten.
Comment
This parameter allows you to create an annotation for the activity. The input text will be displayed above the activity name.
How to use it?
When working with documents, there is a common necessity to have a template file where you need to substitute the required values and save them as a new file. This activity allows you to automate this routine - all you need to do is to prepare the template file and configure the bot to substitute the values in this file.