Skip to content

Commit 5eaf947

Browse files
committed
Added documentation for more supported functions such as pow, subString
1 parent 5e1f49c commit 5eaf947

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/declarative-customization/column-formatting.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,13 @@ Operators specify the type of operation to perform. The following operators are
11711171
- length
11721172
- abs
11731173
- loopIndex
1174+
- floor
1175+
- ceiling
1176+
- pow
1177+
- substring
1178+
- getDate
1179+
- getMonth
1180+
- getYear
11741181

11751182
**Binary arthmetic operators** - The following are the standard arithmetic binary operators that expect two operands:
11761183

@@ -1224,6 +1231,21 @@ Operators specify the type of operation to perform. The following operators are
12241231
- `"txtContent":"=length(45)"` results in _1_
12251232
- `"txtContent":"=length(0)"` results in _0_
12261233

1234+
- **floor**: returns the largest integer les than or equal to a given number. - _Only available in SharePoint Online_
1235+
- `"txtContent":"=floor(45.5)"` results in _45_
1236+
1237+
- **ceiling**: rounds the given number up to the next largest whole number or integer. - _Only available in SharePoint Online_
1238+
- `"txtContent":"=ceiling(45.5)"` results in _46_
1239+
1240+
- **getDate**: returns the day of the month of the given date. - _Only available in SharePoint Online_
1241+
- `"txtContent":"=getDate(Date('12/26/1981'))"` results in _26_
1242+
1243+
- **getMonth**: returns the month in the specified date according to local time, as a zero-based value (where zero indicates the first month of the year). - _Only available in SharePoint Online_
1244+
- `"txtContent":"=getMonth(Date('12/26/1981'))"` results in _11_
1245+
1246+
- **getYear**: returns the year of the given date. - _Only available in SharePoint Online_
1247+
- `"txtContent":"=getYear(Date('12/26/1981'))"` results in _1981_
1248+
12271249
**Binary operators** - The following are operators that expect two operands:
12281250

12291251
- **indexOf**: takes 2 operands. The first is the text you would like to search within, the second is the text you would like to search for. Returns the index value of the first occurence of the search term within the string. Indexes start at 0. If the search term is not found within the text, -1 is returned. This operator is case-sensitive. - _Only available in SharePoint Online_
@@ -1235,7 +1257,22 @@ Operators specify the type of operation to perform. The following operators are
12351257
- **join**: takes 2 operands. The first is an array (multi-select person or choice field) and the second is the separating string. Returns a string concatenation of the array values separated by the separating string. - _Only available in SharePoint Online_
12361258
- `"txtContent": "=join(@currentField, ', ')"` might result in _"Apple, Orange, Cherry"_ (depending on the selected values)
12371259
- `"txtContent": "=join(@currentField.title, '|')"` might result in _"Chris Kent|Vesa Juvonen|Jeff Teper"_ (depending on the selected persons)
1260+
1261+
- **pow**: returns the base to the exponent power. - _Only available in SharePoint Online_
1262+
- `"txtContent":"=pow(2,3)"` results in _8_
12381263

1264+
**Ternary operators** - The following are operators that expect three operands:
1265+
1266+
- **subString**: returns the part of the string between the start and end indicies. - _Only available in SharePoint Online_
1267+
- `"txtContent":"=subString('DogFood', 3, 4)"` results in _Fo_
1268+
- `"txtContent":"=subString('DogFood', 4, 3)"` results in _Fo_
1269+
- `"txtContent":"=subString('DogFood', 3, 6)"` results in _Food_
1270+
- `"txtContent":"=subString('DogFood', 6, 3)"` results in _Food_
1271+
1272+
The substring() method returns the part of the string between the start and end indexes, or to the end of the string.
1273+
1274+
1275+
12391276
**Conditional operator** - The conditional operator is:
12401277

12411278
- **?**: Conditional operations written in Abstract Tree Syntax use `?` as the operator. This is to achieve an expression equivalent to a ? b : c, where if the expression a evaluates to true, then the result is b, else the result is c. For Excel style expressions you write these with an `if` statement. Regardless, there are 3 operands. The first is the condition to evaluate. The second is the result when the condition is true. The third is the result when the condition is false.

0 commit comments

Comments
 (0)