Col2Array Operator
Overview
The Col2Array operator converts a column in a table to an array An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects.. Tables are an indexed array of objects An object is a type of data structure that represents a single, self-contained entity that acts as a container for the characteristics of that entity.. The Col2Array operator converts an array of objects into an array of values.
You'll find the Col2Array operator under the Table group to the left of the Data Workflow canvas.
About the Info Window
Learn more about each setting in the Col2Array operator's Info window:
Info |
|
---|---|
Label |
Sets the label for your operator, displaying below the 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. |
Preserve Argument Type |
When selected, this setting ensures the argument data type is respected when the operator executes. |
Drop Empty |
When set to No, where the source column has empty cells, the final array has indexed, empty values (""). When set to Yes, the final array will not include the empty cells. |
Path |
Enter the name (column header) of the specific column you want to convert to an array. |
Default Value |
When Drop Empty is set to No, any empty cells in the source column are replaced with the default value entered here. |
Adding a Col2Array Operator
In this example, you'll configure a Data Table component to store random names, followed by a Data Workflow component to convert the data table column in to an array.
These instructions assume you have a new module open and saved with a title.
Configure the Data Table Component
First, you'll configure a Data Table component to store your data and input it into a Data Workflow component.
1. | In the Module Builder, drag and drop a ![]() |
2. | In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter dtTable. |
3. | In the data table, enter the following: |
A |
|
---|---|
1 |
name |
2 |
Minna |
3 |
Veronika |
4 |
Theola |
5 |
Albina |
6 |
Ezekiel |
4. | Click Save Component. |
Configure the Data Workflow Component
Next, you'll configure a Data Workflow component to retrieve the stored data and use a Col2Array operator to convert the column into an array An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects..
1. | Drag and drop a Data Workflow onto your canvas, placing it below the ![]() |
Configure the Input Operator
1. | Drag and drop an Input operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Info | |
---|---|
Category |
Input |
Component |
dtTable |
Required |
Yes |
Source |
Default |
Configure the First Console Operator
Configure a Console operator before the Col2Array operator to view the current data in the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software..
1. | Drag and drop a Console operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Info |
|
---|---|
Category |
Console |
Label |
Before Col2Array |
3. | Connect the output port (right) of the Input operator to the input port (left) of the Console operator. |
Configure the Col2Array Operator
1. | Drag and drop an Col2Array operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Info | |
---|---|
Category |
Col2Array |
Label |
|
Drop Empty |
Yes |
Path |
name |
Default Value |
|
3. | Connect the output port (right) of the Input operator to the input port (left) of the Col2Array operator. |
Configure the Second Console Operator
Now, add a second Console operator to view the converted array after the data passes through the Col2Array operator.
1. | Drag and drop another Console operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Info |
|
---|---|
Category |
Console |
Label |
After Col2Array |
3. | Connect the output port (right) of the Col2Array operator to the input port (left) of the After Col2Array Console operator. |
4. | Click Save Component. |
Here's how the completed Data Workflow looks:
Configure the Button Component
Lastly, add a Button component to trigger the Data Workflow and convert the column in the data table to an array An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects..
1. | Drag and drop a ![]() ![]() |
2. | In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter btnRunDWF. |
3. | In the Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter Run Col2Array. |
4. | From the Action Type drop-down, select Event. |
5. | From the On Click drop-down, select dwfCol2Array. |
6. | Click Save Component. |
7. | Save your module. |
Here's how the completed use case looks in the Module Builder:
Preview your module in Express View Express View is how your end-user views your application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the module in Express View. and open the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.. Click the button and check the data before and after Col2Array operation.
Overview
The Col2Array operator converts a column in a table to an array An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects.. Tables are an indexed array of objects An object is a type of data structure that represents a single, self-contained entity that acts as a container for the characteristics of that entity.. The Col2Array operator converts an array of objects into an array of values.
You'll find the Col2Array operator under the Table group to the left of the Data Workflow canvas.
About the Info Window
Here's a breakdown of each setting in the Info window:
Setting |
Description |
---|---|
Label |
Sets the label for your operator, displaying below the 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. |
Preserve Argument Type |
When selected, this setting ensures the argument data type is respected when the operator executes. |
Drop Empty |
When set to No, where the source column has empty cells, the final array has indexed, empty values (""). When set to Yes, the final array will not include the empty cells. |
Path |
Enter the name (column header) of the specific column you want to convert to an array. |
Default Value |
When Drop Empty is set to No, any empty cells in the source column are replaced with the default value entered here. |
Adding a Col2Array Operator
In this example, you'll configure a Data Table component to store random names, followed by a Data Workflow component to convert the data table column in to an array.
These instructions assume you have a new module open and saved with a title.
Configure the Data Table Component
First, you'll configure a Data Table component to store your data and input it into a Data Workflow component.
|
Configure the Data Workflow Component
Next, you'll configure a Data Workflow component to retrieve the stored data and use a Col2Array operator to convert the data column into an array An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects..
1. | Drag and drop a Data Workflow onto your canvas, placing it below the ![]() |
Configure the Input Operator
1. | Drag and drop an Input operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Input |
Component |
dtTable |
Required |
Yes |
Source |
Default |
Configure the First Console Operator
Now, add a Console operator before the Col2Array operator to view the current data in the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software..
1. | Drag and drop a Console operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Console |
Label |
Before Col2Array |
3. | Connect the output port (right) of the Input operator to the input port (left) of the Console operator. |
Configure the Col2Array Operator
1. | Drag and drop an Col2Array operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Col2Array |
Label |
|
Drop Empty |
Yes |
Path |
name |
Default Value |
|
3. | Connect the output port (right) of the Input operator to the input port (left) of the Col2Array operator. |
Configure the Second Console Operator
Then, add a second Console operator to view the converted array after the data passes through the Col2Array operator.
1. | Drag and drop another Console operator onto your Data Workflow canvas. |
2. | Configure the operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Console |
Label |
After Col2Array |
3. | Connect the output port (right) of the Col2Array operator to the input port (left) of the After Col2Array Console operator. |
4. | Click Save. |
Here's how the completed Data Workflow looks:
Configure the Button Component
Lastly, add a Button component to trigger the Data Workflow and convert the column in the data table to an array An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects..
1. | Drag and drop a ![]() ![]() |
2. | In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter btnRunDWF. |
3. | In the Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter Run Col2Array. |
4. | To the left of the component's configuration window, click ![]() |
5. | Set the Action Type as Event. |
6. | From the On Click drop-down, select dwfCol2Array. |
7. | Click Save & Close. |
8. | Save your module |
Below is the completed configuration in the Module Builder:
Preview your module in Express View Express View is how your end-user views your application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the module in Express View. and open the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.. Click the button and check the data before and after Col2Array operation.
Resources