Create Table Operator

Overview

To create an empty array or data table, start your Data Workflow with a Create Table operator. This operator creates an array with as many empty rows as you want. You can fill these rows with data later.

To set the number of rows, you can:

  • Use the operator's Info window.

  • Use another component as an argument for the operator.

The Create Table operator always serves as an input to your Data Workflow, so there's no need for an input port. Unlike the Input and Group Input operators, this operator has an argument port. Arguments add a dynamic aspect to data processing. They can create conditions, rules, and more functionality for an operator.

You can find the Create Table operator under the I/O group to the left of your canvas.

What You'll Learn

In this article, you'll learn:

About the Info Window

Here's what a Create Table 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.

Create Index

When set to YES, the operator creates a key named index for each row or object. This field holds an integer value of the index for that row. This index makes it easier to parse or position your data based on the order of their rows.

When set to NO, your operator does not create an index.

You might want an index if you plan to use the Merge or Append operators in your Data Workflow.

Number of Rows

Sets the number of rows to create. The number you enter here is how many rows the operator creates. If you need 2 rows, enter 2.

To use another operator as an argument, connect its output port to the argument (top) port first. Then, enter _arg as your Number of Rows. For this to work, your argument operator must output an integer.

Adding a Create Table Operator

To demonstrate a Create Table operator, you'll create an empty table with 2 rows.

Here's how the completed use case looks in the Module Builder:

Here's how the completed use case works in Express View, including a peek at the DevTools Console:

What You'll Need

To set up this use case, you’ll need:

  • 1 Hidden component

  • 1 Button component

  • 1 Data Workflow component

To set up your Data Workflow, you'll need:

  • 1 Create Table operator

  • 1 Output operator

Configure the Hidden Component

Before you can add your Data Workflow, you need a place to store its output. For that, you'll use a Hidden component.

1. Drag and drop a Hidden component onto your canvas.
2. Enter tableOutput in the Property ID and Label Text fields.
3. Click Save.

Configure the Data Workflow Component

Next, you'll set up the Data Workflow itself.

1. Drag and drop a Data Workflow component onto your canvas. Place your Data Workflow component above your Hidden component.
2. Enter dwfTable in the Label and Property Name fields.
3. Select Manual from the Trigger Type drop-down menu.

Configure the Create Table Operator

1. Drag and drop a Create Table operator onto your Data Workflow canvas.
2. Configure the Create Table operator's Info window as follows:

Setting

Value

Category

Create Table

Label

 

Create Index

Yes

Number of Rows

2

Configure the Output Data 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

tableOutput

Action

Value

3. Connect the output port (right) of the Create Table operator to the input port (left) of the Output operator.
4. Click Save.

Configure the Button Component

Finally, to trigger the Data Workflow, add a Button component.

1. Drag and drop a Button component onto your canvas. Place your Button component above your Data Workflow component.
2. Enter btnTrigger in the Property ID field.
3. Enter Trigger Data Workflow in the Label Text field.
4. Enter dwfTable in the Trigger on Click.

5. Click Save.
6. Save your module.

Now you can test out your Data Workflow. When you click your button, the Data Workflow triggers. The Data Workflow then creates a table with 2 objects, each containing a field called index. The Data Workflow then puts the resulting table in your Hidden component. Normally, you have other operators in your Data Workflow to fill the table with data. But for demonstration purposes, you can view the table using the DevTools Console:

Changing a Create Table 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 a Create Table 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.

TIP  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.

TIP  Did you know you can copy an operator and paste it into a different Data Workflow? You'll use the same steps outlined above.

Removing a Create Table 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.

NOTE  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.

Lab

You can view this complete use case here: https://training.unqork.io/#/form/5f4d3a72972685021f686544/edit.