Using Text Merge in FlowLast Updated: 07/27/2016 Introduced in Verision: 2.0 |
Decisions includes a number of built-in text merge fields like “Capitalize,” “Lower,” and “Insert Current Date.” These merge fields can be used to dynamically manipulate strings or insert data from other sources into a Text Merge.
Text merge extensions allow you to write custom text merge logic to accomplish any type of merge you would like. This example will show how to use Text Merge in the Flow.
Example
In this Example we will use Text Merge step in our flow to create an URL builder.
Begin with navigating into your Designer Folder and clicking Create Flow from folder’s Action menu.
Name the flow and click Create to continue.
In the Flow Designer start-up window locate [Pick or Create Form] step from Forms[Interaction] category.
Click Add to add this step to the flow.
From this step’s options select Pick or Create Form, Name the Form and click Create to continue. This form will serve our flow as a search bar where user will type keywords he is looking for in the Decisions Documentation. This form was designed as follows…
Next, locate Replace Text in String step in Data > Text category and drag it to the workspace.
From its Options we select Show Mapping Editor
In the Mapping Editor we will use the string from the first form as an input parameter and next we Constantly replace all spaces in this string with plus signs “+”.
We rename the outcome String and it finishes our mapping for Replace Text in String step. We can click Ok to save and close Mapping Editor.
From the Text Merges > [Current Folder] we drag our URLBuilder TextMerge to the workspace, connected to our Replace Text step and select Edit TextMerge from its Options menu.
This TextMerge is designed as follow… It has a static string followed by string variable [Search] which is going to be our input parameter from Replace Text in String step. We can save and close our TextMerge Designer.
Next, drag to the workspace another [Pick or Create Form] step from Forms[Interaction] category.
This form is designed to display the user URL that can be used to display search results from Decisions Documentation based on user’s input in the first form. Save and close form designer to get back to the flow designer.
Connect all steps to complete our flow and click Debug Flow to test the result.
Note that in Decisions version 3.5 and above, you will need to click Test Flow rather than Debug Flow.
We enter some key words into the search bar in the first form and press Search to continue.
And our flow builds a URL for us that can be used to display the search results on our requested key words from Decisions Documentation.