Query Binding and Value Binding
Block Group: | no group |
Icon: | no icon |
A Query Binding or Value Binding block contains all of the information that is configured in the Binding Dialog Box. See Binding Dialog. These blocks are located in the dataflow model of the dataflow block that owns the target property.
For information on using dataflow blocks, see Dataflow.
How to Add and Edit a Query Binding Block to a Dataflow Model
This block cannot be added via the Blocks pane. To add and edit a Query Binding block:
- Drag the source node or metric to the target block property.
Drop the binding source on the target property in the Block Properties pane.
This opens the Binding dialog box.
Note
You cannot create a binding by dropping a node or metric on the target property in the Dataflow pane.
- To configure Query Binding block properties, do one of the following:
- Use the Binding dialog box. Changes affect the Query Binding block.
- Open the dataflow model of the block that owns the target property of the binding.
How to Add a Value Binding Block to a Dataflow Model
This block cannot be added via the Blocks pane. To add and edit a Value Binding block:
- Begin dragging the source block property to the target block property.
- While dragging, press and hold the Ctrl key.
Drop the binding source on the binding target.
This opens the Binding dialog box and creates a Value Binding block for the target property.
- To configure Value Binding block properties, do one of the following:
- Use the Binding dialog box. Changes affect the Value Binding block.
- Open the dataflow model of the block that owns the target property of the binding.
Input/Output Properties
The following properties of the Query Binding or Value Binding block can take input and give output.
- path (string)
- enabled (boolean)
- expression (string)
- mode (enum)
- offset (enum)
- Offset Value (number)
- input min (number)
- input max (number)
- output min (number)
- output max (number)
- gradient
- mapping
- case n
- then n
- default
path specifies the path to the binding source.
enabled specifies whether this block is enabled.
- TRUE—When the source property value changes, the target property updates.
- FALSE—The target property does not update when the source property changes.
expression specifies the string to use to format the source value. This creates the target value as a formatted string. The expression can include a number format pattern. See Scripting and Syntax. The expression can also include other strings, such as units. Number format patterns must be in square brackets ([]). The string value enclosed in square brackets becomes the exact source value, as a string.
mode specifies the type of calculation to perform on the source value. If the mapping property is set to a value other than none, the mapping overrides the mode. The value of the mode property can be one of the following:
- value—Returns the exact source value.
- formatted—Returns the source value, reformatted as specified by a default formatting string.
- expression—Returns the source value, reformatted as specified by a custom formatting string. Requires the expression property to be set.
- offset—Returns the result of a calculation that uses the source value, an operator, and a number. Requires the offset and Offset Value properties to be set.
- scale—Finds the source value's position on an original scale, and returns the corresponding value on a new scale. Requires the input min, input max, output min, and output max values to be set.
- gradient—Finds the source value’s position on an original scale, and returns the corresponding color on a gradient. Requires the input min, input max, and gradient values to be set.
offset specifies the offset operator that is used to modify the target value. The offset property applies only when the mode property is set to offset. The value of the offset property can be one of the following:
- add—The source value and Offset Value property are added together.
- subtract—The Offset Value property is subtracted from the source value.
- multiply—The source value and Offset Value property are multiplied together.
- divide—The source value is divided by the Offset Value property. A decimal value is returned.
- modulo—The source value is divided by the Offset Value property. The remainder is returned.
- divide (int)—The source value is divided by the Offset Value property. The quotient is returned, rounded down to the nearest integer.
Offset Value specifies the number that is used to modify the target value. The Offset Value property applies only when the mode property is set to offset.
input min specifies the lower bound of the original scale. The input min property applies only when the mode property is set to scale or gradient.
input max specifies the upper bound of the original scale. The input max property applies only when the mode property is set to scale or gradient.
output min specifies the lower bound of the new scale. The output min property applies only when the mode property is set to scale.
output max specifies the upper bound of the new scale. The output max property applies only when the mode property is set to scale.
gradient determines the colors for a gradient. For information about editing a gradient, see Fill and Border Pop-Ups. The gradient property applies only when the mode property is set to gradient.
mapping determines the type of mapping. The value of the mapping property can be one of the following:
- none—No mapping is used. Instead, the type of calculation that is specified by the mode property is used.
- number—The input value is treated as a number.
- string—The input value is treated as a string.
- enum—The input value is treated as an enum value.
- bool—The input value is treated as a Boolean value.
case n specifies a test value to compare with the source value.
then n specifies a value to assign to the target if the expression with case n evaluates to TRUE. See Binding Dialog.
default specifies a value to assign to the target if none of the mapping expressions evaluate to TRUE. See Binding Dialog.
Output Property
The following property of the Query Binding or Value Binding block can give output but cannot take input.
- output
output returns the target value.