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
Copy file name to clipboardExpand all lines: articles/data-factory/tutorial-pipeline-return-value.md
+44-12Lines changed: 44 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,31 +63,63 @@ Value of object type is defined as follows:
63
63
## Retrieving Value in Calling Pipeline
64
64
65
65
The pipeline return value of the child pipeline becomes the activity output of the Execute Pipeline Activity. You can retrieve the information with _@activity('Execute Pipeline1').output.pipelineReturnValue.keyName_. The use case is limitless. For instance, you can use
66
-
* An _int_ value from child pipeline to define the wait period for a [wait activity](control-flow-wait-activity.md)
67
-
* A _string_ value to define the URL for the [Web activity](control-flow-web-activity.md)
66
+
67
+
* An _int_ value from child pipeline to define the wait period for a [wait activity](control-flow-wait-activity.md).
68
+
* A _string_ value to define the URL for the [Web activity](control-flow-web-activity.md).
68
69
* An _expression_ value payload for a [script activity](transform-data-using-script.md) for logging purposes.
69
70
70
71
:::image type="content" source="media/pipeline-return-value/pipeline-return-value-03-calling-pipeline.png" alt-text="Screenshot shows the calling pipeline.":::
71
72
72
73
There are two noticeable callouts in referencing the pipeline return values.
73
74
74
-
1.With _Object_ type, you can further expand into the nested json object, such as _@activity('Execute Pipeline1').output.pipelineReturnValue.keyName.nextLevelKey_
75
-
2. With _Array_ type, you can specify the index in the list, with _@activity('Execute Pipeline1').output.pipelineReturnValue.keyName[0]_. The number is zero indexed, meaning that it starts with 0.
75
+
1. With _Object_ type, you can further expand into the nested json object, such as _@activity('Execute Pipeline1').output.pipelineReturnValue.keyName.nextLevelKey_
76
+
1. With _Array_ type, you can specify the index in the list, with _@activity('Execute Pipeline1').output.pipelineReturnValue.keyName[0]_. The number is zero indexed, meaning that it starts with 0.
76
77
77
78
> [!NOTE]
78
79
> Please make sure that the _keyName_ you are referencing exists in your child pipeline. The ADF expression builder can _not_ confirm the referential check for you.
79
80
> The Pipeline will fail if the key referenced is missing in the payload
80
81
81
82
## Special Considerations
82
83
83
-
While you can include multiple Set Pipeline Return Value activities in a pipeline, it's important to ensure that only one of them is executed in the pipeline.
84
-
85
-
:::image type="content" source="media/pipeline-return-value/pipeline-return-value-04-multiple.png" alt-text="Screenshot with Pipeline Return Value and Branching.":::
86
-
87
-
To avoid the previously described missing key problem when the calling pipeline, we encourage you to have the same list of keys for all branches in child pipeline. Consider using _null_ types for keys that don't have values, in a specific branch.
84
+
* While you can include multiple Set Pipeline Return Value activities in a pipeline, it is important to ensure that only one of them is executed in the pipeline.
85
+
86
+
:::image type="content" source="media/pipeline-return-value/pipeline-return-value-04-multiple.png" alt-text="Screenshot with Pipeline Return Value and Branching.":::
87
+
88
+
To avoid the previously described missing key problem when the calling pipeline, we encourage you to have the same list of keys for all branches in child pipeline. Consider using _null_ types for keys that don't have values, in a specific branch.
89
+
90
+
* The Azure Data Factory expression language does not directly support inline JSON objects. Instead, it's necessary to concatenate strings and expressions properly.
91
+
92
+
For example, for the following JSON expression:
93
+
94
+
```json
95
+
{
96
+
"datetime": "@{utcnow()}",
97
+
"date": "@{substring(utcnow(),0,10)}",
98
+
"year": "@{substring(utcnow(),0,4)}",
99
+
"month": "@{substring(utcnow(),5,2)}",
100
+
"day": "@{substring(utcnow(),8,2)}"
101
+
}
102
+
```
103
+
104
+
An equivalent Azure Data Factory expression would be:
105
+
106
+
```json
107
+
@{
108
+
concat(
109
+
'{',
110
+
'"datetime": "', utcnow(), '", ',
111
+
'"date": "', substring(utcnow(),0,10), '", ',
112
+
'"year": "', substring(utcnow(),0,4), '", ',
113
+
'"month": "', substring(utcnow(),5,2), '", ',
114
+
'"day": "', substring(utcnow(),8,2), '"',
115
+
'}'
116
+
)
117
+
}
118
+
```
88
119
89
120
## Related content
90
-
Learn about another related control flow activity:
0 commit comments