Skip to content

Commit 189ac93

Browse files
committed
Merge branch 'patch-1' of https://github.com/passadis/azure-docs into 2024-10-10-public-prs
2 parents a39f90e + 0ca1f60 commit 189ac93

File tree

1 file changed

+44
-12
lines changed

1 file changed

+44
-12
lines changed

articles/data-factory/tutorial-pipeline-return-value.md

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,63 @@ Value of object type is defined as follows:
6363
## Retrieving Value in Calling Pipeline
6464

6565
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).
6869
* An _expression_ value payload for a [script activity](transform-data-using-script.md) for logging purposes.
6970

7071
:::image type="content" source="media/pipeline-return-value/pipeline-return-value-03-calling-pipeline.png" alt-text="Screenshot shows the calling pipeline.":::
7172

7273
There are two noticeable callouts in referencing the pipeline return values.
7374

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.
7677

7778
> [!NOTE]
7879
> 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.
7980
> The Pipeline will fail if the key referenced is missing in the payload
8081
8182
## Special Considerations
8283

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+
```
88119

89120
## Related content
90-
Learn about another related control flow activity:
91-
- [Set Variable Activity](control-flow-set-variable-activity.md)
92-
- [Append Variable Activity](control-flow-append-variable-activity.md)
93121

122+
Learn about another related control flow activity:
123+
124+
* [Set Variable Activity](control-flow-set-variable-activity.md)
125+
* [Append Variable Activity](control-flow-append-variable-activity.md)

0 commit comments

Comments
 (0)