Assign
System.Activities.Statements.Assign
The "Assign" activity in AutomatR is a fundamental and versatile activity used for assigning values to variables or properties. It enables the dynamic manipulation of data within workflows, allowing users to set or update the value of a variable or property based on specific conditions or calculations.
Properties
Name | Description |
---|---|
Misc | |
Display Name | The display name of the activity. A display name is automatically generated when you indicate a target. |
To | Specifies the variable or property to which the value will be assigned. You can select an existing variable or create a new one directly from the "To" property. Variables of various types (int, string, bool, etc.) or properties of specific activities. You can also create new variables by clicking the ellipsis (...) and defining the variable in the Variable Manager. |
Value | Specifies the value to be assigned to the variable or property defined in the "To" property. This value can be a constant, a result of an expression, or a value stored in another variable. Variables of various types, constants, or expressions. You can use existing variables, literal values (e.g., "Hello, World!"), or expressions that evaluate to the desired value. |
How to use:
- Drag and drop the "Assign" activity onto the workflow.
- In the "To" property, select an existing variable or create a new one using the ellipsis (...) and define it in the Variable Manager.
- In the "Value" property, specify the value to be assigned to the variable. This can be a constant, an expression, or the value of another variable.
Example: Consider a simple example where the "Assign" activity is used to concatenate two strings and assign the result to a variable:
Assign:
Display Name: "Concatenate Strings"
To: resultString (String variable)
Value: "Hello, " + name (String variable)
In this example, the "Assign" activity concatenates the string "Hello, " with the value stored in the variable "name" and assigns the result to the variable "resultString."
The "Assign" activity is a powerful tool for manipulating data within AutomatR workflows, enabling dynamic assignments and updates to variables and properties. It is widely used for tasks such as data processing, calculations, and value transformations in automation projects.