You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the Set Variable activity to set the value of an existing variable of type String, Bool, or Array defined in a Data Factory or Synapse pipeline or use the Set Variable activity to set a pipeline return value (preview), which can be used in a parent pipeline.
18
+
Use the Set Variable activity to set the value of an existing variable of type String, Bool, or Array defined in a Data Factory or Synapse pipeline or use the Set Variable activity to set a pipeline return value (preview).
19
19
20
20
21
21
## Setting a variable in the Set Variable activity with UI
@@ -24,42 +24,51 @@ To use a Set Variable activity in a pipeline, complete the following steps:
24
24
25
25
1. Select the background of the pipeline canvas and use the Variables tab to add a variable:
26
26
27
-
:::image type="content" source="media/control-flow-activities-common/add-pipeline-array-variable.png" alt-text="Screenshot shows an empty pipeline canvas with the variables tab selected having an array type variable named TestVariable.":::
27
+
:::image type="content" source="media/control-flow-activities-common/add-pipeline-array-variable.png" alt-text="Screenshot shows an empty pipeline canvas with the variables tab selected having an array type variable named TestVariable.":::
28
28
29
29
2. Search for _Set Variable_ in the pipeline Activities pane, and drag a Set Variable activity to the pipeline canvas.
30
+
30
31
3. Select the Set Variable activity on the canvas if it is not already selected, and then click the **Settings** tab to edit its details.
31
-
4. Select the variable for the Name property.
32
-
5. Enter an expression to set the value for the variables. This expression can be a literal string expression, or any combination of dynamic [expressions, functions](control-flow-expression-language-functions.md), [system variables](control-flow-system-variables.md), or [outputs from other activities](how-to-expression-language-functions.md#examples-of-using-parameters-in-expressions).
33
-
:::image type="content" source="media/control-flow-set-variable-activity/set-variable-activity.png" alt-text="Screenshot shows the ui for a set variable activity.":::
34
32
35
-
## Type properties
33
+
4. Select the variable for the Name property.
36
34
37
-
Property | Description | Required
38
-
-------- | ----------- | --------
39
-
name | Name of the activity in pipeline | yes
40
-
description | Text describing what the activity does | no
41
-
type | Must be set to **SetVariable** | yes
42
-
variableName | Name of the variable that is set by this activity | yes
43
-
value | String literal or expression object value that the variable is assigned to | yes
35
+
5. Enter an expression to set the value for the variables. This expression can be a literal string expression, or any combination of dynamic [expressions, functions](control-flow-expression-language-functions.md), [system variables](control-flow-system-variables.md), or [outputs from other activities](how-to-expression-language-functions.md#examples-of-using-parameters-in-expressions).
44
36
37
+
:::image type="content" source="media/control-flow-set-variable-activity/set-variable-activity.png" alt-text="Screenshot shows the ui for a set variable activity.":::
38
+
45
39
## Setting a pipeline return value in the Set Variable activity with UI
46
40
47
41
The Set Variable activity now allows you to set a pipeline return value (preview). The pipeline return value is a system variable that allows you to customize a value that can be consumed by a parent pipeline and used downstream in your pipeline.
48
42
49
43
To set a pipeline return value, complete the following steps:
50
44
51
45
1. Search for _Set Variable_ in the pipeline Activities pane, and drag a Set Variable activity to the pipeline canvas.
46
+
52
47
2. Select the Set Variable activity on the canvas if it is not already selected, and then click the **Settings** tab to edit its details.
53
-
4. Select **Pipeline return value (preview)** for your **Variable type**.
54
-
5. Enter a **Name** for your variable and select the **Type** from the drop-down menu.
55
-
6. Enter an expression to set the value for the pipeline return value. This expression can be a literal string expression, or any combination of dynamic [expressions, functions](control-flow-expression-language-functions.md), [system variables](control-flow-system-variables.md), or [outputs from other activities](how-to-expression-language-functions.md#examples-of-using-parameters-in-expressions).
48
+
49
+
3. Select **Pipeline return value (preview)** for your **Variable type**.
50
+
51
+
4. Enter a **Name** for your variable and select the **Type** from the drop-down menu.
52
+
53
+
5. Enter an expression to set the value for the pipeline return value. This expression can be a literal string expression, or any combination of dynamic [expressions, functions](control-flow-expression-language-functions.md), [system variables](control-flow-system-variables.md), or [outputs from other activities](how-to-expression-language-functions.md#examples-of-using-parameters-in-expressions).
56
54
57
55
:::image type="content" source="media/control-flow-set-variable-activity/set-pipeline-return-value.png" alt-text="Screenshot shows the UI for setting a pipeline return value.":::
58
56
57
+
## Type properties
58
+
59
+
Property | Description | Required
60
+
-------- | ----------- | --------
61
+
name | Name of the activity in pipeline | yes
62
+
description | Text describing what the activity does | no
63
+
type | Must be set to **SetVariable** | yes
64
+
variableName | Name of the variable that is set by this activity | yes
65
+
value | String literal or expression object value that the variable is assigned to | yes
66
+
59
67
60
68
## Incrementing a variable
61
69
62
-
A common scenario involving variables is using a variable as an iterator within an until or foreach activity. In a set variable activity, you cannot reference the variable being set in the `value` field. To work around this limitation, set a temporary variable and then create a second set variable activity. The second set variable activity sets the value of the iterator to the temporary variable.
70
+
A common scenario involving variables is to use a variable as an iterator within an **Until** or **ForEach** activity. In a **Set variable** activity, you cannot reference the variable being set in the `value` field. To work around this limitation, set a temporary variable and then create a second **Set variable** activity. The second **Set variable** activity sets the value of the iterator to the temporary variable.
0 commit comments