Create Value Operator
Overview
To pass a value to another component, add a Create Value operator to your Data Workflow. You can use this operator to create the following:
-
Strings
-
Booleans
-
Numbers
Most often, you use this operator in tandem with a logic component. For example, to create a value of GO to trigger a Plug-In or Calculator component.
The Create Value operator always serves as the start of your Data Workflow, so it has no need for an input port. Like the Create Table operator, this operator has an argument port. You can use an argument with your Create Value operator to determine the value it creates. You connect another operator to the Create Value operator's argument port. Then, you enter _arg in the Expression/Value field of the operator's Info window to reference that value.
You can find the Create Value 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 Value 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. |
Preserve Argument Type |
When selected, this setting ensures the argument data type is respected when the operator executes. |
Expression/Value |
Sets the value to create and pass to another operator. You can create a number, a string, or a boolean value. To create a number, enter the number here. To create a string, enter the string here surrounded by single quotes. To create a boolean, enter either TRUE or FALSE. |
Adding a Create Value Operator
To demonstrate a Create Value operator, you'll create a simple value of 2.
NOTE These instructions assume that you have a new module open, saved, and with a title.
Here's how the completed use case looks in the Module Builder:
Here's how the completed use case works in Express View Express View is how your end-user views you 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., including a peek at the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software.:
Configure the Hidden Component
Before you can add your Data Workflow, you need a place to store its output. For that, you use a Hidden component.
1. | Drag and drop a Hidden component onto your canvas. |
3. | Click Save & Close. |
Configure the Data Workflow Component
1. | Drag and drop a Data Workflow component onto your canvas, placing it above your valueOutput Hidden component. |
2. | In the Canvas Label Text and Property Name fields, enter dwfValue. |
3. | Set the Trigger Type Deteremines how the component triggers. to Manual. |
Configure the Create Value Operator
1. | Drag and drop a Create Value operator onto your Data Workflow canvas. |
2. | Configure the Create Value operator's Info window as follows: |
Setting |
Value |
---|---|
Category |
Create Value |
Label |
|
Preserve Argument Type |
Unchecked (no) |
Expression/Value |
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 |
valueOutput |
Action |
Value |
3. | Connect the output port (right) of the Create Value 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, placing it above your Data Workflow 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 btnTrigger. |
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 Trigger Data Workflow. |
4. | Set the Action Type to Event. |
5. | In the On Click field, enter dwfValue. |
6. | Click Save & Close. |
7. | Save your module. |
Now you can test out your Data Workflow by previewing it in Express View. When you click your button, the Data Workflow triggers, creates a value of 2, and puts it in your Hidden component.
Resources
-
You can view this complete use case here: https://training.unqork.io/#/form/5f4d3bf0972685021f686556/edit.
-
Modify the Create Value operator in the Data Workflow's configuration window.