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
For workflow definitions in [Azure Logic Apps](../logic-apps/logic-apps-overview.md) and [Power Automate](https://docs.microsoft.com/flow/getting-started), some [expressions](../logic-apps/logic-apps-workflow-definition-language.md#expressions) get their values from runtime actions that might not yet exist when your workflow starts running. To reference these values or process the values in these expressions, you can use *functions* provided by the [Workflow Definition Language](../logic-apps/logic-apps-workflow-definition-language.md).
20
14
21
15
> [!NOTE]
22
16
> This reference page applies to both Azure Logic Apps and Power Automate,
@@ -25,33 +19,23 @@ in these expressions, you can use *functions* provided by the
25
19
> For more information about functions and expressions in Power Automate, see
26
20
> [Use expressions in conditions](https://docs.microsoft.com/flow/use-expressions-in-conditions).
27
21
28
-
For example, you can calculate values by using math functions, such as the
when you want the sum from integers or floats. Here are other
31
-
example tasks that you can perform with functions:
22
+
For example, you can calculate values by using math functions, such as the [add()](../logic-apps/workflow-definition-language-functions-reference.md#add) function, when you want the sum from integers or floats. Here are other example tasks that you can perform with functions:
32
23
33
24
| Task | Function syntax | Result |
34
25
| ---- | --------------- | ------ |
35
26
| Return a string in lowercase format. | toLower('<*text*>') <p>For example: toLower('Hello') | "hello" |
To find functions [based on their general purpose](#ordered-by-purpose),
40
-
review the following tables. Or, for detailed information about each function,
41
-
see the [alphabetical list](#alphabetical-list).
30
+
To find functions [based on their general purpose](#ordered-by-purpose), review the following tables. Or, for detailed information about each function, see the [alphabetical list](#alphabetical-list).
42
31
43
32
> [!NOTE]
44
-
> In the syntax for parameter definitions, a question mark (?)
45
-
> that appears after a parameter means the parameter is optional.
46
-
> For example, see [getFutureTime()](#getFutureTime).
33
+
> In the syntax for parameter definitions, a question mark (?) that appears after a parameter
34
+
> means the parameter is optional. For example, see [getFutureTime()](#getFutureTime).
47
35
48
36
## Functions in expressions
49
37
50
-
To show how to use a function in an expression,
51
-
this example shows how you can get the value from
52
-
the `customerName` parameter and assign that value
53
-
to the `accountName` property by using the
54
-
[parameters()](#parameters) function in an expression:
38
+
To show how to use a function in an expression, this example shows how you can get the value from the `customerName` parameter and assign that value to the `accountName` property by using the [parameters()](#parameters) function in an expression:
55
39
56
40
```json
57
41
"accountName": "@parameters('customerName')"
@@ -76,10 +60,8 @@ so that you get a combined string, "SophiaOwen":
76
60
"customerName": "@concat('Sophia', 'Owen')"
77
61
```
78
62
79
-
Or, you can get string values from parameters. This example
80
-
uses the `parameters()` function in each `concat()` parameter
81
-
and the `firstName` and `lastName` parameters. You then pass
82
-
the resulting strings to the `concat()` function so that
63
+
Or, you can get string values from parameters. This example uses the `parameters()` function in each `concat()` parameter
64
+
and the `firstName` and `lastName` parameters. You then pass the resulting strings to the `concat()` function so that
83
65
you get a combined string, for example, "SophiaOwen":
84
66
85
67
```json
@@ -88,17 +70,14 @@ you get a combined string, for example, "SophiaOwen":
88
70
89
71
Either way, both examples assign the result to the `customerName` property.
90
72
91
-
Here are the available functions ordered by their general purpose,
92
-
or you can browse the functions based on [alphabetical order](#alphabetical-list).
73
+
Here are the available functions ordered by their general purpose, or you can browse the functions based on [alphabetical order](#alphabetical-list).
93
74
94
75
<aname="ordered-by-purpose"></a>
95
76
<aname="string-functions"></a>
96
77
97
78
## String functions
98
79
99
-
To work with strings, you can use these string functions
100
-
and also some [collection functions](#collection-functions).
101
-
String functions work only on strings.
80
+
To work with strings, you can use these string functions and also some [collection functions](#collection-functions). String functions work only on strings.
102
81
103
82
| String function | Task |
104
83
| --------------- | ---- |
@@ -121,8 +100,7 @@ String functions work only on strings.
121
100
122
101
## Collection functions
123
102
124
-
To work with collections, generally arrays, strings,
125
-
and sometimes, dictionaries, you can use these collection functions.
103
+
To work with collections, generally arrays, strings, and sometimes, dictionaries, you can use these collection functions.
126
104
127
105
| Collection function | Task |
128
106
| ------------------- | ---- |
@@ -143,10 +121,7 @@ and sometimes, dictionaries, you can use these collection functions.
143
121
144
122
## Logical comparison functions
145
123
146
-
To work with conditions, compare values and expression results,
147
-
or evaluate various kinds of logic, you can use these logical comparison functions.
148
-
For the full reference about each function, see the
To work with conditions, compare values and expression results, or evaluate various kinds of logic, you can use these logical comparison functions. For the full reference about each function, see the [alphabetical list](../logic-apps/workflow-definition-language-functions-reference.md#alphabetical-list).
150
125
151
126
| Logical comparison function | Task |
152
127
| --------------------------- | ---- |
@@ -165,12 +140,14 @@ For the full reference about each function, see the
165
140
166
141
## Conversion functions
167
142
168
-
To change a value's type or format, you can use these conversion functions.
169
-
For example, you can change a value from a Boolean to an integer.
170
-
For more information about how Logic Apps handles content types during
171
-
conversion, see [Handle content types](../logic-apps/logic-apps-content-type.md).
172
-
For the full reference about each function, see the
To change a value's type or format, you can use these conversion functions. For example, you can change a value from a Boolean to an integer. For more information about how Logic Apps handles content types during conversion, see [Handle content types](../logic-apps/logic-apps-content-type.md). For the full reference about each function, see the [alphabetical list](../logic-apps/workflow-definition-language-functions-reference.md#alphabetical-list).
144
+
145
+
> [!NOTE]
146
+
> Azure Logic Apps automatically converts values between some data types,
147
+
> which means that you don't have to manually perform these conversions.
148
+
> However, if you do so, you might experience unexpected display behaviors,
149
+
> which don't affect the actual conversions, only how they are shown.
150
+
> For more information, see [Implicit data type conversions](#implicit-data-conversions).
174
151
175
152
| Conversion function | Task |
176
153
| ------------------- | ---- |
@@ -198,6 +175,39 @@ For the full reference about each function, see the
198
175
|[xml](../logic-apps/workflow-definition-language-functions-reference.md#xml)| Return the XML version for a string. |
199
176
|||
200
177
178
+
<aname="implicit-data-conversions"></a>
179
+
180
+
## Implicit data type conversions
181
+
182
+
Azure Logic Apps automatically or implicitly converts between some data types, so you don't have to manually convert these types. For example, if you use non-string values where strings are expected as inputs, Logic Apps automatically converts the non-string values into strings.
183
+
184
+
For example, suppose a trigger returns a numerical value as output:
185
+
186
+
`triggerBody()?['123']`
187
+
188
+
If you use this numerical output where string input is expected, such as a URL, Logic Apps automatically converts the value into a string by using the curly braces (`{}`) notation:
189
+
190
+
`@{triggerBody()?['123']}`
191
+
192
+
### Base64 encoding and decoding
193
+
194
+
Logic Apps automatically or implicitly performs base64 encoding or decoding, so you don't have to manually perform these operations by using the corresponding expressions:
195
+
196
+
*`base64(<value>)`
197
+
*`base64ToBinary(<value>)`
198
+
*`base64ToString(<value>)`
199
+
*`base64(decodeDataUri(<value>))`
200
+
*`concat('data:;base64,',<value>)`
201
+
*`concat('data:,',encodeUriComponent(<value>))`
202
+
*`decodeDataUri(<value>)`
203
+
204
+
> [!NOTE]
205
+
> If you manually add these expressions to your logic app, for example, by using the expression editor,
206
+
> navigate away from the Logic App Designer and return to the designer, the designer shows only the
207
+
> parameter values. The expressions are preserved in code view only if you don't edit the parameter
208
+
> values. Otherwise, Logic Apps removes the expressions from code view, leaving only the parameter values.
209
+
> This behavior doesn't affect encoding or decoding, only whether the expressions are shown.
210
+
201
211
<aname="math-functions"></a>
202
212
203
213
## Math functions
@@ -962,6 +972,13 @@ And returns this result: `["hello"]`
962
972
963
973
Return the base64-encoded version for a string.
964
974
975
+
> [!NOTE]
976
+
> Azure Logic Apps automatically performs base64 encoding and decoding,
977
+
> which means that you don't have to manually perform these conversions.
978
+
> However, if you do so, you might experience unexpected display behaviors,
979
+
> which don't affect the actual conversions, only how they are shown.
980
+
> For more information, see [Implicit data type conversions](#implicit-data-conversions).
981
+
965
982
```
966
983
base64('<value>')
967
984
```
@@ -992,6 +1009,13 @@ And returns this result: `"aGVsbG8="`
992
1009
993
1010
Return the binary version for a base64-encoded string.
994
1011
1012
+
> [!NOTE]
1013
+
> Azure Logic Apps automatically performs base64 encoding and decoding,
1014
+
> which means that you don't have to manually perform these conversions.
1015
+
> However, if you do so, you might experience unexpected display behaviors,
1016
+
> which don't affect the actual conversions, only how they are shown.
1017
+
> For more information, see [Implicit data type conversions](#implicit-data-conversions).
1018
+
995
1019
```
996
1020
base64ToBinary('<value>')
997
1021
```
@@ -1022,11 +1046,14 @@ And returns this result:
1022
1046
1023
1047
### base64ToString
1024
1048
1025
-
Return the string version for a base64-encoded string,
1026
-
effectively decoding the base64 string.
1027
-
Use this function rather than [decodeBase64()](#decodeBase64).
1028
-
Although both functions work the same way,
1029
-
`base64ToString()` is preferred.
1049
+
Return the string version for a base64-encoded string, effectively decoding the base64 string. Use this function rather than [decodeBase64()](#decodeBase64), which is deprecated.
1050
+
1051
+
> [!NOTE]
1052
+
> Azure Logic Apps automatically performs base64 encoding and decoding,
1053
+
> which means that you don't have to manually perform these conversions.
1054
+
> However, if you do so, you might experience unexpected display behaviors,
1055
+
> which don't affect the actual conversions, only how they are shown.
1056
+
> For more information, see [Implicit data type conversions](#implicit-data-conversions).
1030
1057
1031
1058
```
1032
1059
base64ToString('<value>')
@@ -1631,48 +1658,22 @@ And returns this result: `74`
1631
1658
1632
1659
<aname="decodeBase64"></a>
1633
1660
1634
-
### decodeBase64
1661
+
### decodeBase64 (deprecated)
1635
1662
1636
-
Return the string version for a base64-encoded string,
1637
-
effectively decoding the base64 string.
1638
-
Consider using [base64ToString()](#base64ToString)
1639
-
rather than `decodeBase64()`.
1640
-
Although both functions work the same way,
1641
-
`base64ToString()` is preferred.
1642
-
1643
-
```
1644
-
decodeBase64('<value>')
1645
-
```
1646
-
1647
-
| Parameter | Required | Type | Description |
1648
-
| --------- | -------- | ---- | ----------- |
1649
-
| <*value*> | Yes | String | The base64-encoded string to decode |
1650
-
|||||
1651
-
1652
-
| Return value | Type | Description |
1653
-
| ------------ | ---- | ----------- |
1654
-
| <*decoded-base64-string*> | String | The string version for a base64-encoded string |
1655
-
||||
1656
-
1657
-
*Example*
1658
-
1659
-
This example creates a string for a base64-encoded string:
1660
-
1661
-
```
1662
-
decodeBase64('aGVsbG8=')
1663
-
```
1664
-
1665
-
And returns this result: `"hello"`
1663
+
This function is deprecated, so please use [base64ToString()](#base64ToString) instead.
1666
1664
1667
1665
<aname="decodeDataUri"></a>
1668
1666
1669
1667
### decodeDataUri
1670
1668
1671
-
Return the binary version for a data uniform resource identifier (URI).
1672
-
Consider using [dataUriToBinary()](#dataUriToBinary),
1673
-
rather than `decodeDataUri()`.
1674
-
Although both functions work the same way,
1675
-
`dataUriToBinary()` is preferred.
1669
+
Return the binary version for a data uniform resource identifier (URI). Consider using [dataUriToBinary()](#dataUriToBinary), rather than `decodeDataUri()`. Although both functions work the same way, `dataUriToBinary()` is preferred.
1670
+
1671
+
> [!NOTE]
1672
+
> Azure Logic Apps automatically performs base64 encoding and decoding,
1673
+
> which means that you don't have to manually perform these conversions.
1674
+
> However, if you do so, you might experience unexpected display behaviors,
1675
+
> which don't affect the actual conversions, only how they are shown.
1676
+
> For more information, see [Implicit data type conversions](#implicit-data-conversions).
1676
1677
1677
1678
```
1678
1679
decodeDataUri('<value>')
@@ -1770,12 +1771,14 @@ And return this result: `2`
1770
1771
1771
1772
### encodeUriComponent
1772
1773
1773
-
Return a uniform resource identifier (URI) encoded version for a
1774
-
string by replacing URL-unsafe characters with escape characters.
1775
-
Consider using [uriComponent()](#uriComponent),
1776
-
rather than `encodeUriComponent()`.
1777
-
Although both functions work the same way,
1778
-
`uriComponent()` is preferred.
1774
+
Return a uniform resource identifier (URI) encoded version for a string by replacing URL-unsafe characters with escape characters. Consider using [uriComponent()](#uriComponent), rather than `encodeUriComponent()`. Although both functions work the same way, `uriComponent()` is preferred.
1775
+
1776
+
> [!NOTE]
1777
+
> Azure Logic Apps automatically performs base64 encoding and decoding,
1778
+
> which means that you don't have to manually perform these conversions.
1779
+
> However, if you do so, you might experience unexpected display behaviors,
1780
+
> which don't affect the actual conversions, only how they are shown.
1781
+
> For more information, see [Implicit data type conversions](#implicit-data-conversions).
0 commit comments