Append Operator
Overview
The Append operator lets you bring together values from two different fields. But not in the way the Aggregate operator's Sum By function does it. The Append operator doesn't add the values as the Aggregate operator does. Instead, the Append operator brings your values together as one value. Suppose you want to create a unique username from a first name and last name field. If you enter the first name Willow and last name Kusko, the Append operator brings them together to make WillowKusko.
But the Append operator isn't limited to input fields. The operator also lets you append data tables. Say you collected names and birthdates in two different places. You can use the Append operator to bring them together.
Similar Data Workflow Operators
The Append operator is similar to the Extend and Aggregate operators. Here are the operators compared:
-
Append operator: Combines strings or arrays together. It appends strings using concatenation. It appends two arrays into one array.
-
Extend operator: Combines two objects into a single object. The Extend operator is typically used with Group Input operators to create objects with more than six fields.
-
Aggregate operator: Performs calculations on two or more numbers. This operator supports the Sum By, Count By, Mean By, Max By, and Min By operations.
What You'll Learn
In this article, you'll learn:
About the Info Window
Here's what an Append operator looks like, along with its Info window:
And here's a breakdown of each setting in the Info window:
Setting |
Description |
---|---|
Label |
Sets the label for your operator. The label you enter here shows beneath your operator on your Data Workflow canvas. This field is optional, but set a label if you use more than one of the same operator type. A label helps you identify your operators without opening any Info windows. |
Adding an Append Operator
The following example shows the Append operator in action, using a Data Workflow to bring 2 values together. First, you'll configure Text Field components to serve as your inputs. Then, you'll use a Data Workflow to append the values.
Here's how the completed use case looks in the Module Builder:
Here's how the completed use case looks in Express View:
What You Need
To set up this use case, you need:
-
3 Text Field components
-
1 Data Workflow component
To set up your Data Workflow, you need:
-
2 Input operators
-
1 Append operator
-
1 Output operator
These instructions assume you have a new module open and saved with a title.
Configure the Text Field Components
First, add 3 Text Field components. Your first 2 components serve as your input fields. And your third component serves as the output for your Data Workflow. This last Text Field is where you see your input fields appended.
1. | Drag and drop 3 Text Field components onto your canvas. |
2. | Enter the following Property IDs and Label Text: |
Property ID |
Label Text |
---|---|
firstString |
First String |
secondString |
Second String |
appendedValue |
Appended Value |
3. | In your appendedValue component, set the Disable User Input toggle to ON. |
4. | Save each component as you add it. |
Configure the Data Workflow Component
Next, add your Data Workflow component. You bring your data into the Data Workflow using 2 Input operators. Then, you add an Append operator to bring both values together. Finally, you display the result using an Output operator.
1. | Drag and drop a Data Workflow component onto your canvas. Place your Data Workflow above your appendedValue Text Field component. |
2. | Enter dwfAppendStrings in the Canvas Label Text and Property Name. |
3. | In the Trigger Type drop-down, select Watch. |
Configure the First Input Operator
1. | Drag and drop an Input operator onto your Data Workflow canvas. |
2. | Configure the Input operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Input |
Component |
firstString |
Required |
Yes |
Source |
Default |
Configure the Second Input Operator
1. | Drag and drop another Input operator onto your Data Workflow canvas. |
2. | Configure the Input operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Input |
Component |
secondString |
Required |
Yes |
Source |
Default |
Configure the Append Operator
1. | Drag and drop an Append operator onto your Data Workflow canvas. |
2. | Configure the Append operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Append |
Label |
Append Strings |
3. | Connect the output port (right) of the firstString Input operator to the upper input port (left) of the Append operator. |
4. | Connect the output port (right) of the secondString Input operator to the lower input port (left) of the Append operator. |
Configure the Output Operator
1. | Drag and drop an Output operator onto your Data Workflow canvas. |
2. | Configure the Output operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Output |
Component |
appendedValue |
Action |
value |
3. | Connect the output port (right) of the Append operator to the input port (left) of the Output operator. |
4. | Click Save. |
5. | Save your module. |
Now, preview your module in Express View and enter values into your Text Field components. As you type, you can see the values come together in your Appended Value field.
Editing an Append Operator's Settings
You can revisit and make changes to this operator.
1. | Click the Data Workflow component. |
A 5-button toolbar displays above the component on hover-over.
2. | Click the (Settings) button to open the Data Workflow canvas. |
3. | Click the operator to open its Info Window. |
4. | Make changes to the operator's settings as needed. |
5. | Click Save. |
6. | Save your module. |
Copying an Append Operator
You can make a copy of your operator using familiar keyboard settings. You can copy and paste an exact copy of your operator, matching all settings.
1. | Hover over the Data Workflow component. |
A 5-button toolbar displays above the component on hover-over.
2. | Click the (Settings) button to open the Data Workflow canvas. |
3. | Click the operator you want to duplicate. |
4. | On your keyboard, press Command + C (Mac OS) or Ctrl + C (Windows/Linux) to copy the operator. |
You can copy more than one operator at a time. Hold Command or Ctrl on your keyboard and click all the operators you want to copy. Follow the rest of the steps as usual.
5. | On your keyboard, press Command + V (Mac OS) or Ctrl + V (Windows/Linux) to paste the copied operator(s) to the Data Workflow canvas. |
6. | Click Save. |
7. | Save your module. |
Did you know you can copy an operator and paste it into a different Data Workflow? You'll use the same steps outlined above.
Deleting an Append Operator
Lastly, you can delete this operator from your Data Workflow canvas. You can also use these same steps to delete a connection between two operators.
1. | Hover over the Data Workflow component. |
A 5-button toolbar displays above the component on hover-over.
2. | Click the (Settings) button to open the Data Workflow canvas. |
3. | Click the operator you want to delete. |
4. | On your keyboard, press Delete. |
Once you delete this operator, make sure to connect your remaining operators. If your Data Workflow path doesn't end with an Output or Console operator, your Data Workflow won't work. So, once you delete an operator, make sure to update any remaining paths to end at an Output or Console operator.
5. | Click Save. |
6. | Save your module. |
Resources
Lab
You can view the complete use case here: https://training.unqork.io/#/form/5f6b933c85a56f024db58195/edit.