Replace Bookmarks With TextLast Updated: 08/20/2018 Introduced in Version: 2.0
This tutorial demonstrates how to use Replace Bookmarks With Text step from Data > Documents category in the ToolBox. This step gets bookmarks from the Constant Word Document, replaces them with a desirable Text, and returns an updated Document File.
We begin in the Designer Folder by clicking Create Flow on the Folder Actions panel.
Then, we Name our Flow and click Create to proceed to the Flow Designer.
First, in the Flow Designer, we add a form that we have created to take an Invoice. We will use this Form to get user inputs for our Bookmarks. In this example we add this Form from Flows, Rules, Forms and Reports > Forms [Interactions] > [Parent Folder] > Replacing Bookmarks With Text category.
This form was designed for Replacing Bookmarks With Text (Dynamic) tutorial. It has Text Boxes and Date Pickers for user inputs, and a Submit Button control to submit the Form.
Next, we add Replace Bookmarks With Text step from All Steps [Catalog] > Data > Documents category in the Quick Add Step dialog.
We select this step on the workspace and Step Information Layer pops up. In the Configuration section we use Pick Document File selector to pick our Word Document File.
Document File for this Example looks as following. It is a Template for Invoice with Bookmarks everywhere where text enclosed with square brackets.
In the Flow Designer, we select Edit Input Mapping option from Replace Bookmarks With Text step’s Options Menu.
In the Mapping Editor we connect the Outcome Data Fields from the Form to the respective Bookmark fields. We click Ok to save and close Mapping Editor.
Back in the Flow Designer we add Download Document Form from Flows, Rules, Forms and Reports > Forms [Interactions] > [Parent Folder] > Replacing Bookmarks With Text category in the Quick Add Step dialog.
This Form was designed for Replacing Bookmarks With Text (Dynamic) tutorial. It has two controls. Done Button control from Actions category for closing the Form. And, Download File Download control from File Handling category.
Back in the Flow Designer we connect Done outcome from the Download Document Form to the End Step, and Failed outcome from the Replace Bookmarks With Text step to the End Step in our Flow. Then, we call Mapping Editor for our Download Document Form step.
In the Mapping Editor we connect OutputDocumentFile outcome from the Replace Bookmarks With Text step to the FileHere File Download control on the Form. Then, we save and close Mapping Editor.
This completes our Flow. We click Debug Flow link on the Top Panel in the Flow Designer to test our Flow.
Our Invoice Form opens in the Debugger. We fill in all required fields and click Submit…
Then, Download Document Form opens. We click Download…
Next, we confirm download process, Name our updated Document file, and save it at the desirable location.
Next, we click Done on the Download Document Form in the Debugger.
The Form closes and Diagram Tab in the Debugger indicates that our Flow ran to the End Step with no errors.
Finally, we locate our downloaded file and open it. We can see that all Bookmarks were replaced with user’s data from the Invoice Form.