Create Field Operator

Overview

A static image displaying the Data Workflow component's Create Field Operator icon and configuration window.

The Create Field operator is a multi-purpose function that creates fields. Creators Also known as Unqork Users, or Designer Users; is anyone who is inside the Unqork platform. can also use the Create Field operator to:

You'll find the Create Field operator in the Table group in the menu on the Data Workflow canvas.

About the Info Window

Learn more about each setting in the Create Field operator's Info window:

Setting

Description

Category

Grayed out and non-adjustable setting indicating the operation type.

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.

Do Not Sanitize Formula

When this checkbox is clear, the operator does its best to clean up values coming into or defined in the operator. For example, removing special characters. Some of those special characters include ', $, #, &amp. The operator also cleans up complex values. For example, logically breaking up strings of numbers and letters using underscores. A sample module ID can go from 5f6b4cdfabf886024d4de2d3 to 5f_6b_4cdfabf_886024d_4de_2d_3.

Sanitizing improves performance. But, it can also lead to unexpected data behavior. If your Create Field isn't behaving as expected, try selecting this box.

When selected, the operator uses your values and expressions as-is. This is best when working with complex values or values that should remain unchanged.

By default, this setting is selected, which means the operator doesn't attempt to sanitize.

Preserve Argument Type

When selected, this setting ensures the argument data type is respected when the operator executes.

Field 1-5

The Create Field operator has five different field options letting Creators Also known as Unqork Users, or Designer Users; is anyone who is inside the Unqork platform. add multiple fields using a single operator.

Define the field you want to create or update, using the following format: key=value. For string values, add single or double quotes around the value. For example, employed="yes".

The value part of the key=value expression can also include calculations, conditional expressions, and references to other fields. It can also reference values coming into the argument port, using the alias _arg. For example, this expression that uses a calculation: incomeMonthly=_arg/12. The calculation happens on the input coming into the operator's argument port.

Or this one, that includes a conditional expression, a reference to another field, and a calculation:lowIncome=IF(incomeAnnual<24000,"yes","no"). Conditional expressions should use the following format: key=IF(condition,valueIfTrue,valueIfFalse).

How your data iterates through your Data Workflow depends on the type of key/value pairs you enter in these fields. This iteration order depends on the keys used:

  • Positive integer-like keys are displayed in ascending order.

  • String keys are displayed in insertion order.

  • Symbol keys are displayed in insertion order.

To learn more, view the ECMAScript language here: https://tc39.es/ecma262/#sec-ordinaryownpropertykeys.

Adding a Create Field Operator

In this example, you'll learn how to add the same key/value pairs to every row in a table.

These instructions assume that you have a new module open, saved, and with a title.

Configure the Data Table Component

First, add a Data Table to contain your key/value pairs.

1. In the Module Builder, drag and drop a Dropdown Component IconData Table component onto your canvas.
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 B

1

name

age

2

Cammy

32

3

Josephine

41

34

Ammie

22

A static image displaying the Data Table configuration in the Create Field operator use case.

4. Click Save Component.

Configure the Data Workflow Component

With the Data Table set up, you're ready to use the Create Field operator to add two new key/value pairs to each row.

1. Drag and drop a Data Workflow component onto your canvas, placing it below your dtTable Dropdown Component IconData Table component.
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 dwfCreateField.
3. In the Canvas Label Text Canvas Label Text indicates the purpose of the corresponding field or component. For non-input components, the Canvas Label Text isn't end-user facing, and only appears in the . field, enter dwfCreateField.

Configure the Input Operator

Start by connecting your Data Table to the Data Workflow using an 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 Create Field Operator

Next, set up the Create Field operator. This operator adds two new key/value pairs to each row (object) of your table (array).

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

Category

Create Field

Label

employment

Do Not Sanitize Formula

☐ (unchecked)

Preserve Argument Type

☐ (unchecked)

Field 1

insured="yes"

Field 2

renewalYear=2023

Field 3

 

Field 4

 

Field 5

 
3. Connect the output port (right) of the dtTable Input operator to the input port (left) of the employment Create Field operator.

Configure the First Console Operator

This Console operator shows your data before adding your key/value pairs.

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 Create Field

3. Connect the output port (right) of the dtTable Input operator to the input port (left) of the Before Create Field Console operator.

Configure the Second Console Operator

This Console operator shows your data after adding your key/value pairs.

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 Create Field

3. Connect the output port (right) of the employment Create Field operator to the input port (left) of the After Create Field Console operator.

Here's how the completed Data Workflow looks:

A static image displaying the dwfCreateField Data Workflow.

4. Click Save Component.

Configure the Button Component

Finally, add a Button to trigger your Data Workflow.

1. Drag and drop a Button component Icon Button component onto your canvas, placing it below your dwfCreateField Data Workflow.
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 Create Field.
4. Navigate to the Actions settings.
5. From the Action Type drop-down, select Event.
6. In the On Click field, enter dwfCreateField.

Static image showing the Button component's Action Type configuration in the Create Field operator use case.

7. Click Save Component.
8. Save your module.

Your completed module looks like the following:

A static image displaying the Create Field operator completed use case 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.. Open the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.. Click the Run Create Field button and see what displays in the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.:

A static image displaying the Express View console output of the Data Workflow Create Field Operator.

Overview

A static image displaying the Data Workflow component's Create Field Operator icon and configuration window.

The Create Field operator is a multi-purpose function that creates fields. Creators Also known as Unqork Users, or Designer Users; is anyone who is inside the Unqork platform. can also use the Create Field operator to:

You'll find the Create Field operator in the Table group in the menu on the Data Workflow canvas.

About the Info Window

Learn more about each setting in the Create Field operator's Info window:

Setting

Description

Category

Grayed out and non-adjustable setting indicating the operation type.

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.

Do Not Sanitize Formula

When this checkbox is clear, the operator does its best to clean up values coming into or defined in the operator. For example, removing special characters. Some of those special characters include ', $, #, &amp. The operator also cleans up complex values. For example, logically breaking up strings of numbers and letters using underscores. A sample module ID can go from 5f6b4cdfabf886024d4de2d3 to 5f_6b_4cdfabf_886024d_4de_2d_3.

Sanitizing improves performance. But, it can also lead to unexpected data behavior. If your Create Field isn't behaving as expected, try selecting this box.

When selected, the operator uses your values and expressions as-is. This is best when working with complex values or values that should remain unchanged.

By default, this setting is selected, which means the operator doesn't attempt to sanitize.

Preserve Argument Type

When selected, this setting ensures the argument data type is respected when the operator executes.

Field 1-5

The Create Field operator has five different field options letting Creators Also known as Unqork Users, or Designer Users; is anyone who is inside the Unqork platform. add multiple fields using a single operator.

Define the field you want to create or update, using the following format: key=value. For string values, add single or double quotes around the value. For example, employed="yes".

The value part of the key=value expression can also include calculations, conditional expressions, and references to other fields. It can also reference values coming into the argument port, using the alias _arg. For example, this expression that uses a calculation: incomeMonthly=_arg/12. The calculation happens on the input coming into the operator's argument port.

Or this one, that includes a conditional expression, a reference to another field, and a calculation:lowIncome=IF(incomeAnnual<24000,"yes","no"). Conditional expressions should use the following format: key=IF(condition,valueIfTrue,valueIfFalse).

How your data iterates through your Data Workflow depends on the type of key/value pairs you enter in these fields. This iteration order depends on the keys used:

  • Positive integer-like keys are displayed in ascending order.

  • String keys are displayed in insertion order.

  • Symbol keys are displayed in insertion order.

To learn more, view the ECMAScript language here: https://tc39.es/ecma262/#sec-ordinaryownpropertykeys.

Adding a Create Field Operator

In this example, you'll see how to add the same key/value pairs to every row in a table.

These instructions assume that you have a new module open, saved, and with a title.

Configure the Data Table Component

First, add a Data Table to contain your key/value pairs.

1. Drag and drop a Dropdown Component IconData Table component onto your canvas.
2. In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. and Canvas Label Text Canvas Label Text indicates the purpose of the corresponding field or component. For non-input components, the Canvas Label Text isn't end-user facing, and only appears in the . fields, enter dtTable.
3. In the data table, enter the following: 
  A B

1

name

age

2

Cammy

32

3

Josephine

41

4

Ammie

22

A static image displaying the Data Table configuration in the Create Field operator use case.

4. Click Save & Close.

Configure the Data Workflow Component

With the Data Table set up, you're ready to use the Create Field operator to add two new key/value pairs to each row.

1. Drag and drop a Data Workflow component onto your canvas, placing it below your dtTable Dropdown Component IconData Table component.
2. In the Canvas Label Text Canvas Label Text indicates the purpose of the corresponding field or component. For non-input components, the Canvas Label Text isn't end-user facing, and only appears in the . and Property Name fields, enter dwfCreateField.

Configure the Input Operator

Start by connecting your Data Table to the Data Workflow using an 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 Create Field Operator

Next, set up the Create Field operator. This operator adds two new key/value pairs to each row (object) of your table (array).

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

Setting

Value

Category

Create Field

Label

employment

Do Not Sanitize Formula

Unchecked (no)

Preserve Argument Type

Unchecked (no)

Field 1

insured="yes"

Field 2

renewalYear=2023

3. Connect the output port (right) of the dtTable Input operator to the input port (left) of the employment Create Field operator.

Configure the First Console Operator

This Console operator shows your data before adding your key/value pairs.

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 Create Field

3. Connect the output port (right) of the dtTable Input operator to the input port (left) of this first Before Create Field Console operator.

Configure the Second Console Operator

This Console operator shows your data after adding your key/value pairs.

1. Drag and drop another Console operator onto your Data Workflow canvas.
2. Configure operator's Info window as follows:

Setting

Value

Category

Console

Label

After Create Field

3. Connect the output port (right) of the employment Create Field operator to the input port (left) of the After Create Field Console operator.

Your complete Data Workflow looks like the following:

4. Click Save.

Configure the Button Component

Finally, add a Button to trigger your Data Workflow.

1. Drag and drop a Button component Icon Button component onto your canvas, placing it below your dwfCreateField Data Workflow.
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 Create Field.
4. Set the Action Type to Event.
5. In the On Click field, enter dwfCreateField.

Static image showing the Button component's Action Type configuration in the Create Field operator use case.

6. Click Save & Close.
7. Save your module.

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

A static image displaying the Create Field operator completed use case 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.. Open the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.. Click the Run Create Field button and see what displays in the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.: