Create a Text Merge
  • 12 Nov 2020
  • 3 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Create a Text Merge

  • Dark
    Light

Overview

In Decisions, pre-defined Text Merges can be created and executed from a Designer Folder or Flow that merge written text and data together. This operates the same as the Merge Plain/HTML Text input mapping type, except that feature is only applicable to single input mappings. When a custom Text Merge is created and referenced in a Flow, the Text Merge inputs can be defined with Flow data for dynamic mapping. This allows for more flexibility when Text Merges require access to different pieces of data in the application.

Example

The Text Merge Designer is its own interface, similar to how it would appear when using the input mapping type. There are several pre-built Calculated Fields that can be used in the custom merge if applicable. This example will explore the Text Merge interface and how Calculated Fields functions at runtime. 



In a Designer Folder, select the Other button from the bottom Action Bar. Hover the cursor over Text Merge, then select Create Text. When the window appears, enter a Name and keep the Use as Behavior. Once complete, select CREATE.


The Designer interface for Text Merge has a large text area in the center, the Data and Calculated Fields listed on the left, and the configuration options on the right. For data to be usable in the Text Merge, it must be added as Input Data in the PROPERTIES configurations. Even though it is added in the text merge, the input will still need value definition at runtime. 

Select the Add New button under the Input Data box, then define the input data member being added with a name and type. The added input data will appear under the Data section on the left. Items from the left can be added to the text editor by hovering the cursor over the name of the item, then selecting the plus icon. 

This example uses Capitalize from the Calculated Field section. When this item is added to the text editor, it will appear as a gray label. Select the label and choose the Edit option from the menu. When the window appears, choose the text that should be capitalized at runtime (only input data will appear in this list). Use the Save button once complete.


In the Designer Folder, right-click the name of the Text Merge and choose the Preview TextMerge option from the menu. Enter a name and select OK to see that the text has been capitalized as the function intended. This result can be saved as HTML, a PDF, or a DOC file. Select CLOSE once complete.


Select the CREATE FLOW button from the bottom Action Bar in the Designer Folder. Choose the default template and select CREATE. Name the Flow, then select CREATE again. In the Flow Designer, connect the Start and End step, then hover over the connecting line and select the plus icon. Type the name of the custom Text Merge into the search bar and choose it as an added Flow step. 

The Flow step will have input values that correlate with what was configured in the Text Merge Designer. These inputs can be mapped with Flow data, as shown in the GIF below, or they can be mapped with constant data for a similar effect as previewing the merge. Use the Select From Flow mapping type to define the Text Merge input data values with data from the Flow (Flow Data > Current Account Name).

Select the Debug button from the top toolbar, then select the FULL option when the Debugger appears. Select the Text Merge step icon, then select Execution > View Input/Output Data. As shown, the name that was pulled from the Flow data has been capitalized. 



Was this article helpful?