Table2Object Operator
Overview
The Table2Object operator helps you create an object 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. from a table. Consider a data table with two columns: key and value. Let's say the first row of your table has a key of name and a value of Josephine. Then, the next row has a key of age and a value of 82. The Table2Object operator takes each row of the table and turns them into key/value pairs in a single object. After performing the operation, the result is the following: {"name":"Josephine", "age":82}.
You'll find the Table2Object operator is located under the Table operators group to the left of the Data Workflow canvas.
About the Info Window
Here's a breakdown of each setting in the Table2Object 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. |
Key Column Name |
Enter the name (header) of the column that contains the keys you want to use in each key/value pair. |
Value Column Name |
Enter the name (header) of the column that contains the values you want to use in each key/value pair. |
Adding a Table2Object Operator
Now, let's explore the Table2Object operator to create an object from a table. You'll begin by setting up a Data Table component that contains two columns: field and value. Each row of the table becomes a key/value pair in the final object.
Configure the Data Table Component
You'll begin by adding a Data Table component and populate it with data that you want to turn into a object.
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. | Complete the data table as follows: |
A | B | |
---|---|---|
1 |
field |
value |
2 |
firstName |
Roxane |
3 |
lastName |
Campain |
4 |
age |
37 |
5 |
occupation |
librarian |
4. | Click Save Component. |
Configure the Data Workflow Component
Next, you'll configure the Data Workflow component, which performs the Table2Object operation.
1. | Drag and drop a Data Workflow component onto your canvas, placing it below the dtTable![]() |
3. | Click Save Component. |
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
Now, add a Console operator before the Table2Object operator to view the current order ooof the 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. | Complete the operator's Info window as follows: |
Info | |
---|---|
Category |
Console |
Label |
Before Table2Object |
3. | Connect the output port (right) of the dtTable Input operator to the input port (left) of the Before Table2ObjectConsole operator. |
4. | Click Save Component |
Configure the Table2Object Operator
Configure the Table2Object operator. Notice that the values you enter in the Info window's Key Column Name and Value Column Name fields match the column headers in your Data Table component.
1. | Drag and drop a Table2Object operator onto your Data Workflow canvas. |
2. | Complete the operator's Info window as follows: |
Info | |
---|---|
Category |
Table2Object |
Label |
Convert to Object |
Preserve Argument Type |
☐ (unchecked) |
Key Column Name |
field |
Value Column Name |
value |
3. | Connect the output port (right) of the dtTableInput operator to the input port (left) of the Convert to ObjectTable2Object operator. |
4. | Click Save Component |
Configure the Second Console Operator
Then, add a second Console operator to view the result of your Data Workflow.
1. | Drag and drop a Console operator onto your Data Workflow canvas. |
2. | Complete the operator's Info window as follows: |
Info | |
---|---|
Category |
Console |
Label |
After Table2Object |
3. | Connect the output port (right) of the Convert to ObjectTable2Object operator to the input port (left) of the After Table2ObjectConsole operator. |
4. | Click Save Component |
Configure the Button Component
Lastly, configure a Button component to trigger the Data Workflow 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..
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 Table2Object. |
4. | Navigate to the Actions settings. |
5. | From the Action Type drop-down, select Event. |
6. | From the On Click drop-down, enter or select dwfTable2Object. |
7. | Click Save Component. |
8. | Save your module. |
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 Run Table2Object button and review the data posted in the console.
Overview
The Table2Object operator helps you create an object 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. from a table. Consider a data table with two columns: key and value. Let's say the first row of your table has a key of name and a value of Josephine. Then, the next row has a key of age and a value of 82. The Table2Object operator takes each row of the table and turns them into key/value pairs in a single object. After performing the operation, the result is the following: {"name":"Josephine", "age":82}.
You'll find the Table2Object operator under the Table operators group to the left of the Data Workflow canvas.
About the Info Window
Here's a breakdown of each setting in the Table2Object operator's 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. |
Key Column Name |
Enter the name (header) of the column that contains the keys you want to use in each key/value pair. |
Value Column Name |
Enter the name (header) of the column that contains the values you want to use in each key/value pair. |
Adding a Table2Object Operator
Now, let's explore the Table2Object operator to create an object from a table. You'll begin by setting up a Data Table component that contains two columns: field and value. Each row of the table becomes a key/value pair in the final object.
Configure the Data Table Component
You'll begin by adding a Data Table component and populate it with data that you want to turn into a object.
1. | In the Module Builder, drag and drop a ![]() |
3. | To the left of the component's configuration window, click Data. |
4. | In the data table, enter the following: |
A | B | |
---|---|---|
1 |
field |
value |
2 |
firstName |
Roxane |
3 |
lastName |
Campain |
4 |
age |
37 |
5 |
occupation |
librarian |
5. | Click Save & Close. |
Configure the Data Workflow Component
Next, you'll set up the Data Workflow component, which performs the Table2Object operation.
1. | Drag and drop a Data Workflow component onto your canvas, placing it below the dtTable![]() |
Configure the 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 |
dtTable |
Required |
Yes |
Source |
Default |
Configure the First Console Operator
Now, add a Console operator before the Table2Object operator to view the current order 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. | Complete the operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Get |
Label |
Before Table2Object |
3. | Connect the output port (right) of the dtTableInput operator to the input port (left) of the Before Table2ObjectConsole operator. |
Configure the Table2Object Operator
Configure the Table2Object operator. Notice that the values you enter in the Info window's Key Column Name and Value Column Name fields match the column headers in your Data Table.
1. | Drag and drop a Table2Object operator onto your Data Workflow canvas. |
2. | Complete the operator's Info window as follows: |
Setting |
Description |
---|---|
Label |
Convert to Object |
Preserve Argument Type |
☐ (unchecked) |
Key Column Name |
field |
Value Column Name |
value |
3. | Connect the output port (right) of the dtTableInput operator to the input port (left) of the Convert to ObjectTable2Object operator. |
Configure the Second Console Operator
Add a Console operator to help you view the result of your Data Workflow.
1. | Drag and drop another Console operator onto your Data Workflow canvas. |
2. | Complete the operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Console |
Label |
After Table2Object |
3. | Connect the output port (right) of the Convert to ObjectTable2Object operator to the input port (left) of the After Table2ObjectConsole operator. |
Here's how the completed Data Workflow looks:
Configure the Button Component
Lastly, configure a Button component to trigger the Data Workflow 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..
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 Table2Object. |
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 dwfTable2Object. |
7. | Click Save & Close. |
8. | Save your module |
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 Run Table2Object button and review the data posted in the console.