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: docs/declarative-customization/column-formatting.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Use column formatting to customize SharePoint
3
3
description: Customize how fields in SharePoint lists and libraries are displayed by constructing a JSON object that describes the elements that are displayed when a field is included in a list view, and the styles to be applied to those elements.
4
-
ms.date: 06/28/2022
4
+
ms.date: 08/12/2022
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -707,6 +707,7 @@ The following column types support column formatting:
Copy file name to clipboardExpand all lines: docs/declarative-customization/formatting-syntax-reference.md
+29-3Lines changed: 29 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Formatting syntax reference
3
3
description: Formatting syntax reference
4
-
ms.date: 08/03/2022
4
+
ms.date: 08/12/2022
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -198,6 +198,12 @@ An optional property that specifies style attributes to apply to the element spe
198
198
'--inline-editor-border-style'
199
199
'--inline-editor-border-radius'
200
200
'--inline-editor-border-color'
201
+
202
+
'-webkit-line-clamp'
203
+
204
+
'object-fit'
205
+
'transform'// Only translate(arg) and translate(arg, arg) are currently supported
206
+
201
207
```
202
208
203
209
The following example shows the value of a style object. In this example, two style properties (`padding` and `background-color`) will be applied. The `padding` value is a hard-coded string value. The `background-color` value is an Expression that is evaluated to either red (`#ff0000`) or green (`#00ff00`) depending on whether the value of the current field (specified by `@currentField`) is less than 40. For more information, see the Expression object section.
@@ -278,11 +284,11 @@ An optional property that is meant for debugging. It outputs error messages and
278
284
279
285
## forEach
280
286
281
-
An optional property that allows an element to duplicate itself for each member of a specific multi-value field. The value of `"forEach"` property should be in the format of either `"iteratorName in @currentField"` or `"iteratorName in [$FieldName]"`.
287
+
An optional property that allows an element to duplicate itself for each member of a specific multi-value field or an array. The value of `"forEach"` property should be in the format of either `"iteratorName in @currentField"` or `"iteratorName in [$FieldName]"` or `"iteratorName in Expression-Returning-An-Array"`.
282
288
283
289
`iteratorName` represents the name of iterator variable that is used to represent the current member of the multi-value field. The name of the iterator can be any combination of alphanumeric characters and underscore (`_`) that does not start with a digit.
284
290
285
-
The field used in the loop must be in a supported field type with multi-value option enabled: Person, Lookup, and Choice.
291
+
The field used in the loop must be in a supported field type with multi-value option enabled: Person, Lookup, and Choice. An expression returning an array can also be used.
286
292
287
293
In the element with `forEach` or its children elements, the iterator variable can be referred as if it is a new field. The index of the iterator can be accessed with `loopIndex` operator.
288
294
@@ -428,6 +434,8 @@ Values for `txtContent`, style properties, and attribute properties can be expre
428
434
429
435
Expressions can be written using Excel-style expressions in SharePoint Online, or by using Abstract Syntax Tree expressions in SharePoint Online and SharePoint 2019.
430
436
437
+
All fields in ViewFields can be referred in expresisons, even if it is marked `Explicit`.
438
+
431
439
### Excel-style expressions
432
440
433
441
All Excel-style expressions begin with an equal (`=`) sign. This style of expression is only available in SharePoint Online (not SharePoint 2019).
@@ -544,13 +552,15 @@ Operators specify the type of operation to perform. The following operators are
544
552
- startsWith
545
553
- endsWith
546
554
- replace
555
+
- replaceAll
547
556
- padStart
548
557
- padEnd
549
558
- getUserImage
550
559
- addDays
551
560
- addMinutes
552
561
- appendTo
553
562
- removeFrom
563
+
- split
554
564
555
565
**Binary arithmetic operators** - The following are the standard arithmetic binary operators that expect two operands:
556
566
@@ -645,6 +655,8 @@ Operators specify the type of operation to perform. The following operators are
645
655
-**removeFrom**: returns an array with the given entry removed from the given array, if present
646
656
-`"txtContent": "=removeFrom(@currentField, 'Choice 4')"` returns an array with 'Choice 4' removed from the @currentField array
647
657
-`"txtContent": "=removeFrom(@currentField, '[email protected]')"` returns an array with '[email protected]' removed from the @currentField array
658
+
-**split**: divides the given string into an ordered list of substrings by searching for the given pattern, and returns an array of these substrings
659
+
-`"txtContent": "=removeFrom('Hello World', ' ')"` returns an array with 2 strings - 'Hello' and 'World'
648
660
-**addDays**: returns a datetime object with days added (or deducted) from the given datetime value
649
661
-`"txtContent": "=addDays(Date('11/14/2021'), 3)"` returns a 11/17/2021, 12:00:00 AM
650
662
-`"txtContent": "=addDays(Date('11/14/2021'), -1)"` returns a 11/13/2021, 12:00:00 AM
@@ -666,6 +678,8 @@ Operators specify the type of operation to perform. The following operators are
666
678
-`"txtContent":"=replace('Hello world', 'world', 'everyone')"` results in _Hello everyone_
667
679
-`"txtContent":"=replace([$MultiChoiceField], 'Choice 1', 'Choice 2')"` returns an array replacing Choice 1 with Choice 2
-**replaceAll**: searches a string for a specified value and returns a new string (or array) where the specified value is replaced.
682
+
-`"txtContent":"=replaceAll('H-e-l-l-o W-o-r-l-d', '-', '')"` results in _Hello World_
669
683
-**padStart**: pads the current string with another string until the resulting string reaches the given length. The padding is applied from the start of the current string.
670
684
-`"txtContent":"=padStart('DogFood', 10, 'A')"` results in _AAADogFood_
671
685
-`"txtContent":"=padStart('DogFood', 10, 'AB')"` results in _ABADogFood_
@@ -1149,3 +1163,15 @@ This also works with field name
1149
1163
"txtContent": "[$FieldName.displayValue]"
1150
1164
}
1151
1165
```
1166
+
1167
+
### "@isSelected"
1168
+
1169
+
This will evaluate to `true` for selected item(s) in a view and `false` otherwise.
1170
+
1171
+
### "@lcid"
1172
+
1173
+
This will evaluate to the LCID of current culture. This can be used to format the date, time and numbers.
1174
+
1175
+
### "@UIlcid"
1176
+
1177
+
This will evaluate to the LCID of current UI culture. This can be used to show localized display strings.
0 commit comments