Description
The ConcatGen Generator combines (concatenates) two or more values together and returns a single string result. Concatenated values can be referenced (Linked Generators/Attributes), constant values, delimiters, or formatting elements (e.g., space, hyphen). It can be used to merge strings or dynamically build values such as file names, identifiers, logs, messages, and more.
In This Article
- Video Training
- Generator Parameters
- How to use the ConcatGen Generator
- Example 1 - Combine First and Last Names
- Example 2 - Create Account Identifier with Branch Code
- Example 3 - Create Account Identifiers Using Multiple Branch Codes
- Additional Information
Video Training
The following video can be used to see a quick tutorial on how to use the ConcatGen Generator:
Generator Parameters
The following parameters may be configured for the ConcatGen Generator. Items with an asterisk* are required.
- list - Defines a list of strings to concatenate.
- caseType* - Defines if the case of the string should be changed. The options are: noCase, lowerCase, and upperCase.
How to use the ConcatGen Generator
To use the ConcatGen Generator, you will need to complete these steps:
Step 1 - Assign the ConcatGen Generator to an Attribute
- Create or select an Attribute for a Domain. Click here to learn more.
- Assign the ConcatGen to the Attribute. Click here to learn more.
Step 2 - Add Constant or Referenced Values to the list Parameter
Referenced Values
Double click in the field to select an Attribute, Generator, or other item to reference.
Select a tab within the pop-up window and then select the Plus (+) to add it as a reference.
The lastName Attribute will be selected in this example.
NOTE: You can use the buttons to the right to rearrange added list items, add a blank space, or perform other actions. For this example, a hyphen has been added and moved to a position between the constant and referenced value.
Step 3 - Finish Making Changes to the Generator Configuration
- (Optional) Choose a different option for the caseType parameter.
- Save changes made to the ConcatGen Generator.
Sample Output
Example 1 - Combine First and Last Names
A tester wants to combine a customer's first and last names with a space between the values.
This example uses three Linked Generators:
- NameGen (gen1) - generates a first name.
- NameGen (gen2) - generates a last name.
- ConcatGen (gen3) - combines the two names with a space in between them.
NameGen (firstName)
Generates a random first name.
NameGen (lastName)
Generates a random last name.
ConcatGen (fullName)
References each NameGen Generator with a space in between to combine the two string values.
Example 2 - Create Account Identifier with Branch Code
A tester wants to combine a branch code with the customer's account number.
This example uses two Linked Generators:
RangeGen (gen1)
Generates a number starting at 1000 and increasing by one on each iteration.
ConcatGen (gen2)
Combines a constant string value "BR01-" with the value generated by the RangeGen (gen1) Generator.
Example 3 - Create Account Identifiers Using Multiple Branch Codes
This example builds upon Example 2 above and uses multiple branch codes (e.g., BR01, BR02, BR03) to create the account identifiers.
This can be done using a ListGen Generator to simulate the required branch codes. It must then be referenced in the ConcatGen. The generated values would be similar to what is shown below:
This example uses three Linked Generators:
ListGen (gen1)
Generates the branch codes that will be used to create the account identifier.
RangeGen (gen2)
Generates a number starting at 1000 and increasing by one on each iteration.
ConcatGen (gen3)
The ConcatGen references the ListGen (gen1), adds a hyphen, and then references the RangeGen (gen2) to provide a value like this: BR01-1000.
Additional Information
Please refer to this page for additional examples and information: Linked ConcatGen Design Pattern.