Merging Data Pairs Using the NVelocity Merge Raw Step
  • 17 Jul 2024
  • 2 Minutes to read
  • Dark
    Light

Merging Data Pairs Using the NVelocity Merge Raw Step

  • Dark
    Light

Article summary

Overview 

As a way to combine Data Pairs with String Data, users may utilize the Custom Merge Raw [NVelocity] step within a Flow. This step allows users the ability to specify both the Template and its Parameters at runtime. These Parameters are presented in the form of Data Pairs and can be mapped to the step by mapping their names into the steps Template Input. The following document demonstrates how to utilize the Custom Merge Raw [NVelocity] step in a Flow to combine a combination of Text input and two Data Pairs. 

Differences between NVelocity Steps 
This step functions similarly to how the Custom Merge [NVelocity] step functions in that it allows users to Merge Data via an NVelocity formatted Template.

The NVelocity Merge Raw Step differs from the standard NVelocity Merge Step in that it utilizes a different method of defining Parameters, allowing the user the ability to dictate the Parameter and Template dynamically. Additionally, defining a Template using this step does not require the use of brackets in its definition. 

Example

  1. From a Designer Project in Decisions Studio, select CREATE FLOW from the Global Action Bar, then CREATE a new Flow
  2. From the Flow Designer, navigate to Toolbox > DATA > DATA PAIR, attach a CreateString Data Pair step to the Start step. 
  3. Select the Create String Data Pair step to navigate to its Properties. Then under INPUTS, Constant map the desired Name; then Constant map "This is a" to the Value Input.
  4. Attach an additional Create String Data Pair step to the Done path of the previously added one. 
  5. From the Properties of the newly added step, Constant map the desired Name, then Constant map "Custom Merge step." to Value. 
  6. From Toolbox > DATA > TEXT, attach a Custom Merge Raw [NVelocity] step, to the Done path of the second Create String Data Pair step and the End step. 

  7. From the Properties of the Custom Merge Raw step, set Parameters to Build Array. Then, Select From Flow map CreateStringDataPair1_Output to Item 0

  8. From the Properties tab for the Custom Merge step, under INPUTS > Parameters, click ADD. Then, map CreateStringDataPair2_Output to Item 1

  9. From the Template Input, Constant map the desired value utilizing a combination of text input and "$[nameofdatapair]" to define where the Data Pairs exist in the Template. For this example, map "$[firstDataPairName] test of the $[secondDataPairName]" to the Template Input. 


  10. Save the Flow, then if desired close via X


Debug 

  1. From the Flow Designer, select the Debug link from the top Action bar. Then click START DEBUGGING. 
  2. After the Flow runs, select the Custom Merge Raw [NVelocity] 1 step and navigate to Execution 1 > View Input/Output Data
  3. Verify the Output MergedString by comparing it against the Input Parameters


Was this article helpful?