---
title: "Designer Variable Blocks"
app: "Warehouse Insight"
section: "How-to guides"
last_updated: "2024-07-23"
url: "https://insight-works.com/kb/warehouse-insight/designer-variable-blocks/"
---

# Designer Variable Blocks

The designer variable blocks serve as defined variables in the application to make it easier to work with data and control process logic. The following sections outline each available variable block type and provide a brief example of how the block can be used.

 Note: Variables are global to the entire application; they can be referenced at any time and do not go out of scope.

### Variable

Variable is used to define an explicit variable. You can either define a new variable or reference one of the available variables in the context. Variables can be of any type (e.g., decimal, string, and Boolean) but are treated as strings.

![Item](/wp-content/uploads/kb-legacy/Item.png)

This block is always used as an input to another block and cannot be placed by itself.

Block Configuration:

| Option | Description |
| --- | --- |
| item | The variable name. Use the dropdown to select a previously-created variable or to create a new one. |

 Note: Use Set Variable to initialize a new variable but not immediately use it.

#### Variable Example

The Application Designer example below uses Variable to reference a PDA Configuration context variable:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-20.png)

### Set Variable

Set Variable is used to set the value of a variable. If the variable does not already exist, it is created.

![Set Item](/wp-content/uploads/kb-legacy/Set-Item.png)

Block Configuration:

| Option | Description |
| --- | --- |
| item | The variable name to set. Use the drop down to select an existing variable or to create a new one. |
| < blank > | Place a variable block to get the value from. |

#### Set Variable Example

The Application Designer example below uses Set Variable to create a new custom variable:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-1-3.png)

### Integer Variable

Integer Variable can be used as an input into another block when you need to specify an integer value and do not need to reference it anywhere else.

![0](/wp-content/uploads/kb-legacy/0.png)

#### Integer Variable Example

The Application Designer example below uses Integer Variable:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-2-4.png)

### Text Variable

Text Variable can be used as an input into another block when you need to specify a string value and do not need to reference it anywhere else.

![Input](/wp-content/uploads/kb-legacy/Input.png)

When used with an Expression block or input, Text Variable replaces any variables enclosed in brackets with the current value.

 Note: See Evaluate Text and Evaluate Number for examples of using the text variable with expressions.

#### Text Variable Example

The Application Designer example below uses Text Variable:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-3-2.png)

### Boolean Variable

Use Boolean to indicate a True or False variable.

![True](/wp-content/uploads/kb-legacy/True.png)

#### Boolean Example

The Application Designer example below uses Boolean:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-4-2.png)

### Known Event Variable

Use Known Event to choose a pre-existing Event ID by name. The Known Event options are automatically populated based on _Events_ page in Business Central.

![Nothing Yet](/wp-content/uploads/kb-legacy/Nothing-Yet.png)

The known event options are automatically populated based on the _Events_ page in Business Central.

#### Known Event Example

The Application Designer example below uses Known Event:

![Loading Document Data](/wp-content/uploads/kb-legacy/Loading-Document-Data-2.png)

### Dialog Result Variable

Use Dialog Result to check for a dialog result by name rather than integer.

![OK](/wp-content/uploads/kb-legacy/OK.png)

Available options are:

- OK (integer value of 1)
- Cancel (integer value of 2)
- Yes (integer value of 6)
- No (integer value of 7)

 Note: This variable is typed to the dialog\_result returned by the various interaction blocks.

#### Dialog Result Example

The Application Designer example below uses Dialog Result:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-5-2.png)

### Evaluate Number

Evaluate Number is used to complete simple math expressions and then feed the result into other inputs.

![Evaluate Number](/wp-content/uploads/kb-legacy/Evaluate-Number.png)

Block Configuration:

| Option | Description |
| --- | --- |
| Expression | The expression to evaluate. Should be a string variable with references to variable names inside brackets []. Use: + for addition, – for subtraction, \* for multiplication, / for division. |

#### Evaluate Number Example

The Application Designer example below uses Evaluate Number:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-6-2.png)

### Evaluate Text

Evaluate Text is used to string replace variables into text expressions and then feed the result into other inputs.

![Evaluate Text](/wp-content/uploads/kb-legacy/Evaluate-Text.png)

Block Configuration:

| Option | Description |
| --- | --- |
| Expression | The expression to evaluate. Should be a string variable with references to variable names inside brackets []. |

#### Evaluate Text Example

The Application Designer example below uses Evaluate Text:

![Form Opens](/wp-content/uploads/kb-legacy/Form-Opens-7-2.png)

### Is any lot tracked

Note: Specific item tracking settings (e.g., purchase inbound, sales outbound) can also be referenced from the context.

![Lot Tracked](/wp-content/uploads/kb-legacy/Lot-Tracked.png)

 Note: Specific item tracking settings (e.g., purchase inbound, sales outbound) can also be referenced from the context.

#### Is any lot tracked Example

The Application Designer example below uses Is any lot tracked:

![Scanned Item](/wp-content/uploads/kb-legacy/Scanned-Item-4.png)

### Is any serial tracked

Is any serial tracked is specially designed to return True/False if the current context has any Item Tracking Configuration that requires a serial number.

![Serial Tracked](/wp-content/uploads/kb-legacy/Serial-Tracked.png)

 Note: Specific item tracking settings (e.g., purchase inbound, sales outbound) can also be referenced from the context.

#### Is any serial tracked Example

The Application Designer example below uses Is any serial tracked:

![Scanned Item](/wp-content/uploads/kb-legacy/Scanned-Item-2-1.png)
