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/logic-apps/workflow-definition-language-functions-reference.md
+237-6Lines changed: 237 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,11 +93,14 @@ To work with strings, you can use these string functions and also some [collecti
93
93
94
94
| String function | Task |
95
95
| --------------- | ---- |
96
+
|[chunk](../logic-apps/workflow-definition-language-functions-reference.md#chunk)| Split a string or collection into chunks of equal length. |
96
97
|[concat](../logic-apps/workflow-definition-language-functions-reference.md#concat)| Combine two or more strings, and return the combined string. |
97
98
|[endsWith](../logic-apps/workflow-definition-language-functions-reference.md#endswith)| Check whether a string ends with the specified substring. |
98
99
|[formatNumber](../logic-apps/workflow-definition-language-functions-reference.md#formatNumber)| Return a number as a string based on the specified format |
99
100
|[guid](../logic-apps/workflow-definition-language-functions-reference.md#guid)| Generate a globally unique identifier (GUID) as a string. |
100
101
|[indexOf](../logic-apps/workflow-definition-language-functions-reference.md#indexof)| Return the starting position for a substring. |
102
+
|[isFloat](../logic-apps/workflow-definition-language-functions-reference.md#isInt)| Return a boolean that indicates whether a string is a floating-point number. |
103
+
|[isInt](../logic-apps/workflow-definition-language-functions-reference.md#isInt)| Return a boolean that indicates whether a string is an integer. |
101
104
|[lastIndexOf](../logic-apps/workflow-definition-language-functions-reference.md#lastindexof)| Return the starting position for the last occurrence of a substring. |
102
105
|[length](../logic-apps/workflow-definition-language-functions-reference.md#length)| Return the number of items in a string or array. |
103
106
|[nthIndexOf](../logic-apps/workflow-definition-language-functions-reference.md#nthIndexOf)| Return the starting position or index value where the *n*th occurrence of a substring appears in a string. |
@@ -119,6 +122,7 @@ To work with collections, generally arrays, strings, and sometimes, dictionaries
119
122
120
123
| Collection function | Task |
121
124
| ------------------- | ---- |
125
+
|[chunk](../logic-apps/workflow-definition-language-functions-reference.md#chunk)| Split a string or collection into chunks of equal length. |
122
126
|[contains](../logic-apps/workflow-definition-language-functions-reference.md#contains)| Check whether a collection has a specific item. |
123
127
|[empty](../logic-apps/workflow-definition-language-functions-reference.md#empty)| Check whether a collection is empty. |
124
128
|[first](../logic-apps/workflow-definition-language-functions-reference.md#first)| Return the first item from a collection. |
@@ -127,7 +131,9 @@ To work with collections, generally arrays, strings, and sometimes, dictionaries
127
131
|[join](../logic-apps/workflow-definition-language-functions-reference.md#join)| Return a string that has *all* the items from an array, separated by the specified character. |
128
132
|[last](../logic-apps/workflow-definition-language-functions-reference.md#last)| Return the last item from a collection. |
129
133
|[length](../logic-apps/workflow-definition-language-functions-reference.md#length)| Return the number of items in a string or array. |
134
+
|[reverse](../logic-apps/workflow-definition-language-functions-reference.md#reverse)| Reverse the order of items in an array. |
130
135
|[skip](../logic-apps/workflow-definition-language-functions-reference.md#skip)| Remove items from the front of a collection, and return *all the other* items. |
136
+
|[sort](../logic-apps/workflow-definition-language-functions-reference.md#sort)| Sort items in a collection. |
131
137
|[take](../logic-apps/workflow-definition-language-functions-reference.md#take)| Return items from the front of a collection. |
132
138
|[union](../logic-apps/workflow-definition-language-functions-reference.md#union)| Return a collection that has *all* the items from the specified collections. |
133
139
|||
@@ -269,6 +275,7 @@ For the full reference about each function, see the
269
275
|[convertFromUtc](../logic-apps/workflow-definition-language-functions-reference.md#convertFromUtc)| Convert a timestamp from Universal Time Coordinated (UTC) to the target time zone. |
270
276
|[convertTimeZone](../logic-apps/workflow-definition-language-functions-reference.md#convertTimeZone)| Convert a timestamp from the source time zone to the target time zone. |
271
277
|[convertToUtc](../logic-apps/workflow-definition-language-functions-reference.md#convertToUtc)| Convert a timestamp from the source time zone to Universal Time Coordinated (UTC). |
278
+
|[dateDifference](../logic-apps/workflow-definition-language-functions-reference.md#dateDifference)| Return the difference between two dates as a timespan. |
272
279
|[dayOfMonth](../logic-apps/workflow-definition-language-functions-reference.md#dayOfMonth)| Return the day of the month component from a timestamp. |
273
280
|[dayOfWeek](../logic-apps/workflow-definition-language-functions-reference.md#dayOfWeek)| Return the day of the week component from a timestamp. |
274
281
|[dayOfYear](../logic-apps/workflow-definition-language-functions-reference.md#dayOfYear)| Return the day of the year component from a timestamp. |
@@ -1211,6 +1218,48 @@ These examples show the different supported types of input for `bool()`:
1211
1218
1212
1219
## C
1213
1220
1221
+
<aname="chunk"></a>
1222
+
1223
+
### chunk
1224
+
1225
+
Split a string or array into chunks of equal length.
1226
+
1227
+
```
1228
+
chunk('<collection>', '<length>')
1229
+
chunk([<collection>], '<length>')
1230
+
```
1231
+
1232
+
| Parameter | Required | Type | Description |
1233
+
| --------- | -------- | ---- | ----------- |
1234
+
| <*collection*> | Yes | String or Array | The collection to split |
1235
+
| <*length*> | Yes | The length of each chunk |
1236
+
|||||
1237
+
1238
+
| Return value | Type | Description |
1239
+
| ------------ | ---- | ----------- |
1240
+
| <*collection*> | Array | An array of chunks with the specified length |
1241
+
||||
1242
+
1243
+
*Example 1*
1244
+
1245
+
This example splits a string into chunks of length 10:
1246
+
1247
+
```
1248
+
chunk('abcdefghijklmnopqrstuvwxyz', 10)
1249
+
```
1250
+
1251
+
And returns this result: `['abcdefghij', 'klmnopqrst', 'uvwxyz']`
1252
+
1253
+
*Example 2*
1254
+
1255
+
This example splits an array into chunks of length 5.
Return the difference between two timestamps as a timespan. This function subtracts `startDate` from `endDate`, and returns the result as timestamp in string format.
1651
+
1652
+
```
1653
+
dateDifference('<startDate>', '<endDate>')
1654
+
```
1655
+
1656
+
| Parameter | Required | Type | Description |
1657
+
| --------- | -------- | ---- | ----------- |
1658
+
| <*startDate*> | Yes | String | A string that contains a timestamp |
1659
+
| <*endDate*> | Yes | String | A string that contains a timestamp |
1660
+
|||||
1661
+
1662
+
| Return value | Type | Description |
1663
+
| ------------ | ---- | ----------- |
1664
+
| <*timespan*> | String | The difference between the two timestamps, which is a timestamp in string format. If `startDate` is more recent than `endDate`, the result is a negative value. |
1665
+
||||
1666
+
1667
+
*Example*
1668
+
1669
+
This example subtracts the first value from the second value:
1670
+
1671
+
```
1672
+
dateDifference('2015-02-08', '2018-07-30')
1673
+
```
1674
+
1675
+
And returns this result: `"1268.00:00:00"`
1676
+
1597
1677
<aname="dayOfMonth"></a>
1598
1678
1599
1679
### dayOfMonth
@@ -2052,31 +2132,42 @@ And return these results:
2052
2132
2053
2133
### float
2054
2134
2055
-
Convert a string version for a floating-point number to an actual floating point number. You can use this function only when passing custom parameters to an app, for example, a logic app or flow.
2135
+
Convert a string version for a floating-point number to an actual floating point number. You can use this function only when passing custom parameters to an app, for example, a logic app workflow or Power Automate flow. To convert floating-point strings represented in locale-specific formats, you can optionally specify an RFC 4646 locale code.
2056
2136
2057
2137
```
2058
-
float('<value>')
2138
+
float('<value>', '<locale>'?)
2059
2139
```
2060
2140
2061
2141
| Parameter | Required | Type | Description |
2062
2142
| --------- | -------- | ---- | ----------- |
2063
2143
| <*value*> | Yes | String | The string that has a valid floating-point number to convert. The minimum and maximum values are the same as the limits for the float data type. |
2144
+
| <*locale*> | No | String | The RFC 4646 locale code to use. <br><br>If not specified, default locale is used. <br><br>If *locale* isn't a valid value, an error is generated that the provided locale isn't valid or doesn't have an associated locale. |
2064
2145
|||||
2065
2146
2066
2147
| Return value | Type | Description |
2067
2148
| ------------ | ---- | ----------- |
2068
2149
| <*float-value*> | Float | The floating-point number for the specified string. The minimum and maximum values are the same as the limits for the float data type. |
2069
2150
||||
2070
2151
2071
-
*Example*
2152
+
*Example 1*
2072
2153
2073
2154
This example creates a string version for this floating-point number:
2074
2155
2075
2156
```
2076
-
float('10.333')
2157
+
float('10,000.333')
2158
+
```
2159
+
2160
+
And returns this result: `10000.333`
2161
+
2162
+
*Example 2*
2163
+
2164
+
This example creates a string version for this German-style floating-point number:
2165
+
2166
+
```
2167
+
float('10.000,333', 'de-DE')
2077
2168
```
2078
2169
2079
-
And returns this result: `10.333`
2170
+
And returns this result: `10000.333`
2080
2171
2081
2172
<aname="formatDateTime"></a>
2082
2173
@@ -2537,6 +2628,75 @@ int('10')
2537
2628
2538
2629
And returns this result: `10`
2539
2630
2631
+
<aname="isFloat"></a>
2632
+
2633
+
### isFloat
2634
+
2635
+
Return a boolean indicating whether a string is a floating-point number. By default, this function uses the invariant culture for the floating-point format. To identify floating-point numbers represented in other locale-specific formats, you can optionally specify an RFC 4646 locale code.
2636
+
2637
+
```
2638
+
isFloat('<string>', '<locale>'?)
2639
+
```
2640
+
2641
+
| Parameter | Required | Type | Description |
2642
+
| --------- | -------- | ---- | ----------- |
2643
+
| <*value*> | Yes | String | The string to examine |
2644
+
| <*locale*> | No | String | The RFC 4646 locale code to use |
2645
+
|||||
2646
+
2647
+
| Return value | Type | Description |
2648
+
| ------------ | ---- | ----------- |
2649
+
| <*boolean-result*> | Boolean | A boolean that indicates whether the string is a floating-point number |
2650
+
2651
+
*Example 1*
2652
+
2653
+
This example checks whether a string is a floating-point number in the invariant culture:
2654
+
2655
+
```
2656
+
isFloat('10,000.00')
2657
+
```
2658
+
2659
+
And returns this result: `true`
2660
+
2661
+
*Example 2*
2662
+
2663
+
This example checks whether a string is a floating-point number in the German locale:
2664
+
2665
+
```
2666
+
isFloat('10.000,00', 'de-DE')
2667
+
```
2668
+
2669
+
And returns this result: `true`
2670
+
2671
+
<aname="isInt"></a>
2672
+
2673
+
### isInt
2674
+
2675
+
Return a boolean that indicates whether a string is an integer.
2676
+
2677
+
```
2678
+
isInt('<string>')
2679
+
```
2680
+
2681
+
| Parameter | Required | Type | Description |
2682
+
| --------- | -------- | ---- | ----------- |
2683
+
| <*string*> | Yes | String | The string to examine |
2684
+
|||||
2685
+
2686
+
| Return value | Type | Description |
2687
+
| ------------ | ---- | ----------- |
2688
+
| <*boolean-result*> | Boolean | A boolean that indicates whether the string is an integer |
2689
+
2690
+
*Example*
2691
+
2692
+
This example checks whether a string is an integer:
2693
+
2694
+
```
2695
+
isInt('10')
2696
+
```
2697
+
2698
+
And returns this result: `true`
2699
+
2540
2700
<aname="item"></a>
2541
2701
2542
2702
### item
@@ -3837,6 +3997,36 @@ Here's how the example returned array might look where the outer `outputs` objec
3837
3997
]
3838
3998
```
3839
3999
4000
+
<aname="reverse"></a>
4001
+
4002
+
### reverse
4003
+
4004
+
Reverse the order of items in a collection. When you use this function with [sort()](#sort), you can sort a collection in descending order.
4005
+
4006
+
```
4007
+
reverse([<collection>])
4008
+
```
4009
+
4010
+
| Parameter | Required | Type | Description |
4011
+
| --------- | -------- | ---- | ----------- |
4012
+
| <*collection*> | Yes | Array | The collection to reverse |
4013
+
|||||
4014
+
4015
+
| Return value | Type | Description |
4016
+
| ------------ | ---- | ----------- |
4017
+
|[<*updated-collection*>]| Array | The reversed collection |
0 commit comments