Skip to content

Commit 6219b80

Browse files
authored
Update control-flow-set-variable-activity.md
updates
1 parent cc49a3a commit 6219b80

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

articles/data-factory/control-flow-set-variable-activity.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.reviewer: jburchel
1515
# Set Variable Activity in Azure Data Factory and Azure Synapse Analytics
1616
[!INCLUDE[appliesto-adf-asa-md](includes/appliesto-adf-asa-md.md)]
1717

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), 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).
1919

2020

2121
## 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:
2424

2525
1. Select the background of the pipeline canvas and use the Variables tab to add a variable:
2626

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.":::
2828

2929
2. Search for _Set Variable_ in the pipeline Activities pane, and drag a Set Variable activity to the pipeline canvas.
30+
3031
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.":::
3432

35-
## Type properties
33+
4. Select the variable for the Name property.
3634

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).
4436

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+
4539
## Setting a pipeline return value in the Set Variable activity with UI
4640

4741
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.
4842

4943
To set a pipeline return value, complete the following steps:
5044

5145
1. Search for _Set Variable_ in the pipeline Activities pane, and drag a Set Variable activity to the pipeline canvas.
46+
5247
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).
5654

5755
:::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.":::
5856

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+
5967

6068
## Incrementing a variable
6169

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.
71+
6372
Below is an example of this pattern:
6473

6574
:::image type="content" source="media/control-flow-set-variable-activity/increment-variable.png" alt-text="Screenshot shows increment variable.":::
@@ -123,6 +132,5 @@ Variables are currently scoped at the pipeline level. This means that they are n
123132

124133
## Next steps
125134
Learn about another related control flow activity:
126-
127135
- [Append Variable Activity](control-flow-append-variable-activity.md)
128136

0 commit comments

Comments
 (0)