Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Namespace: Microsoft.Azure.Workflows.Sdk
Provides factory methods for creating variable manipulation actions in Logic Apps workflows. Access this class through WorkflowBuiltInActions by using WorkflowActions.BuiltIn.Variables.
Usage
// Variable actions are accessed via WorkflowActions.BuiltIn.Variables
var trigger = WorkflowTriggers.BuiltIn.CreateHttpTrigger();
var init = WorkflowActions.BuiltIn.Variables.InitializeVariable<int>(
name: () => "counter", value: () => 0).WithName("InitCounter");
var increment = WorkflowActions.BuiltIn.Variables.IncrementVariable<int>(
name: () => "counter", value: () => 1).WithName("AddOne");
trigger.Then(init).Then(increment);
WorkflowFactory.CreateStatefulWorkflow("VariableExample", trigger);
Methods
InitializeVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Creates an IVariableWorkflowAction that declares a workflow variable with its initial value.
IVariableWorkflowAction InitializeVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| Name | Description | Type | Required |
|---|---|---|---|
| name | Expression for the variable name. | Expression<Func<string>> | Yes |
| value | Expression for the initial value. | Expression<Func<T>> | Yes |
var initVar = WorkflowActions.BuiltIn.Variables.InitializeVariable<string>(
name: () => "greeting",
value: () => "Hello").WithName("InitGreeting");
SetVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Creates an IVariableWorkflowAction that assigns a new value to an existing workflow variable.
IVariableWorkflowAction SetVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| Name | Description | Type | Required |
|---|---|---|---|
| name | Expression for the variable name. | Expression<Func<string>> | Yes |
| value | Expression for the new value. | Expression<Func<T>> | Yes |
var setVar = WorkflowActions.BuiltIn.Variables.SetVariable<string>(
name: () => "greeting",
value: () => "Updated greeting").WithName("UpdateGreeting");
IncrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Creates an IVariableWorkflowAction that increments a numeric variable.
IVariableWorkflowAction IncrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| Name | Description | Type | Required |
|---|---|---|---|
| name | Expression for the variable name. | Expression<Func<string>> | Yes |
| value | Expression for the increment value. | Expression<Func<T>> | Yes |
var increment = WorkflowActions.BuiltIn.Variables.IncrementVariable<int>(
name: () => "counter",
value: () => 1).WithName("IncrementCounter");
DecrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Creates an IVariableWorkflowAction that decrements a numeric variable.
IVariableWorkflowAction DecrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| Name | Description | Type | Required |
|---|---|---|---|
| name | Expression for the variable name. | Expression<Func<string>> | Yes |
| value | Expression for the decrement value. | Expression<Func<T>> | Yes |
var decrement = WorkflowActions.BuiltIn.Variables.DecrementVariable<int>(
name: () => "counter",
value: () => 1).WithName("DecrementCounter");
AppendToStringVariable
Creates an IVariableWorkflowAction that appends text to a string variable.
IVariableWorkflowAction AppendToStringVariable(Expression<Func<string>> name, Expression<Func<string>> value)
| Name | Description | Type | Required |
|---|---|---|---|
| name | Expression for the variable name. | Expression<Func<string>> | Yes |
| value | Expression for the string to append. | Expression<Func<string>> | Yes |
var append = WorkflowActions.BuiltIn.Variables.AppendToStringVariable(
name: () => "log",
value: () => " new entry").WithName("AppendLog");
AppendToArrayVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Creates an IVariableWorkflowAction that appends a value to an array variable.
IVariableWorkflowAction AppendToArrayVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| Name | Description | Type | Required |
|---|---|---|---|
| name | Expression for the variable name. | Expression<Func<string>> | Yes |
| value | Expression for the value to append. | Expression<Func<T>> | Yes |
var appendArray = WorkflowActions.BuiltIn.Variables.AppendToArrayVariable<string>(
name: () => "items",
value: () => "new item").WithName("AddItem");
Related Content
- AgentToolContext Class Definition
- IChainableNode Interface Definition
- IVariableWorkflowAction Interface Definition
- IWorkflowAction Interface Definition
- IWorkflowOperation Interface Definition
- IWorkflowProvider Interface Definition
- IWorkflowTrigger Interface Definition
- OperationChain Class Definition
- Typed Workflow Action Interfaces Definition
- Typed Workflow Trigger Interfaces Definition
- WorkflowActionBase Class Definition
- WorkflowActions Class Definition
- WorkflowBuiltInActions Class Definition
- WorkflowBuiltInTriggers Class Definition
- WorkflowContext Class Definition
- WorkflowControlActions Class Definition
- WorkflowFactory Class Definition
- WorkflowManagedActions Class Definition
- WorkflowManagedTriggers Class Definition
- WorkflowProviderExtensions Class Definition
- WorkflowTriggerBase Class Definition
- WorkflowTriggers Class Definition