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
Mapping data flows in Azure Data Factory support the use of parameters. You can define parameters inside of your data flow definition, which you can then use throughout your expressions. The parameter values can be set by the calling pipeline via the Execute Data Flow activity. You have three options for setting the values in the data flow activity expressions:
16
+
Mapping data flows in Azure Data Factory support the use of parameters. Define parameters inside of your data flow definition and use them throughout your expressions. The parameter values are set by the calling pipeline via the Execute Data Flow activity. You have three options for setting the values in the data flow activity expressions:
17
17
18
18
* Use the pipeline control flow expression language to set a dynamic value
19
19
* Use the data flow expression language to set a dynamic value
@@ -37,19 +37,44 @@ You can quickly add additional parameters by selecting **New parameter** and spe
A common pattern is to pass in a column name as a parameter value. To reference the column associated with the parameter, use the `byName()` function. Remember to cast the column to its appropriate type with a casting function such as `toString()`.
42
+
Once you've created a data flow with parameters, you can execute it from a pipeline with the Execute Data Flow Activity. After you add the activity to your pipeline canvas, you will be presented with the available data flow parameters in the activity's **Parameters** tab.
43
43
44
-
For example, if you wanted to map a string column based upon a parameter `columnName`, you can add a derived column transformation equal to `toString(byName($columnName))`.
44
+
When assigning parameter values, you can use either the [pipeline expression language](control-flow-expression-language-functions.md) or the [data flow expression language](data-flow-expression-functions.md)based on spark types. Each mapping data flow can have any combination of pipeline and data flow expression parameters.
45
45
46
-

46
+

47
47
48
-
##Assign parameter values from a pipeline
48
+
### Pipeline expression parameters
49
49
50
-
Once you've created your data flow with parameters, you can execute it from a pipeline with the Execute Data Flow Activity. After you add the activity to your pipeline canvas, you will be presented with the available data flow parameters in the activity's **Parameters** tab.
50
+
Pipeline expression parameters allow you to reference system variables, functions, pipeline parameters, and variables similar to other pipeline activities. When you click **Pipeline expression**, a side-nav will open allowing you to enter an expression using the expression builder.
51
51
52
-

52
+

53
+
54
+
When referenced, pipeline parameters are evaluated and then their value is used in the data flow expression language. The pipeline expression type doesn't need to match the data flow parameter type.
55
+
56
+
#### Example
57
+
58
+
Say you have an integer parameter `intParam` that is referencing a pipeline parameter of type String, `@pipeline.parameters.pipelineParam`.
59
+
60
+

61
+
62
+
`@pipeline.parameters.pipelineParam` is assigned a value of `abs(1)` at runtime.
63
+
64
+

65
+
66
+
When `$intParam` is referenced in an expression such as a derived column, it will evaluate `abs(1)` return `1`.
67
+
68
+

69
+
70
+
### Data flow expression parameters
71
+
72
+
Select **Data flow expression** will open up the data flow expression builder. You will be able to reference functions, other parameters and any defined schema column throughout your data flow. This expression will be evaluated as is when referenced.
73
+
74
+
> [!Note]
75
+
> If you pass in an invalid expression or reference a schema column that doesn't exist in that transformation, the parameter will evaluate to null.
76
+
77
+
### String parameters
53
78
54
79
If your parameter data type is string, when you click the text box to set parameter values, you can choose to enter either a pipeline or a data flow expression. If you choose pipeline expression, you will be presented with the pipeline expression panel. Make sure to include pipeline functions inside string interpolation syntax using `'@{<expression>}'`, for example:
55
80
@@ -60,11 +85,16 @@ If your parameter is not of type string, you will always be presented with the D
60
85
*```toInteger(Role)```
61
86
*```'this is my static literal string'```
62
87
63
-
Each mapping data flow can have any combination of pipeline and data flow expression parameters.
A common pattern is to pass in a column name as a parameter value. To reference the column associated with the parameter, use the `byName()` function. Remember to cast the column to its appropriate type with a casting function such as `toString()`.
67
94
95
+
For example, if you wanted to map a string column based upon a parameter `columnName`, you can add a derived column transformation equal to `toString(byName($columnName))`.
96
+
97
+

68
98
69
99
## Next steps
70
100
*[Execute data flow activity](control-flow-execute-data-flow-activity.md)
0 commit comments