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/formatting-syntax-reference.md
+28-2Lines changed: 28 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -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
@@ -643,6 +653,8 @@ Operators specify the type of operation to perform. The following operators are
643
653
-**removeFrom**: returns an array with the given entry removed from the given array, if present
644
654
-`"txtContent": "=removeFrom(@currentField, 'Choice 4')"` returns an array with 'Choice 4' removed from the @currentField array
645
655
-`"txtContent": "=removeFrom(@currentField, '[email protected]')"` returns an array with '[email protected]' removed from the @currentField array
656
+
-**split**: divides the given string into an ordered list of substrings by searching for the given pattern, and returns an array of these substrings
657
+
-`"txtContent": "=removeFrom('Hello World', ' ')"` returns an array with 2 strings - 'Hello' and 'World'
646
658
-**addDays**: returns a datetime object with days added (or deducted) from the given datetime value
647
659
-`"txtContent": "=addDays(Date('11/14/2021'), 3)"` returns a 11/17/2021, 12:00:00 AM
648
660
-`"txtContent": "=addDays(Date('11/14/2021'), -1)"` returns a 11/13/2021, 12:00:00 AM
@@ -664,6 +676,8 @@ Operators specify the type of operation to perform. The following operators are
664
676
-`"txtContent":"=replace('Hello world', 'world', 'everyone')"` results in _Hello everyone_
665
677
-`"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.
680
+
-`"txtContent":"=replaceAll('H-e-l-l-o W-o-r-l-d', '-', '')"` results in _Hello World_
667
681
-**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.
668
682
-`"txtContent":"=padStart('DogFood', 10, 'A')"` results in _AAADogFood_
669
683
-`"txtContent":"=padStart('DogFood', 10, 'AB')"` results in _ABADogFood_
@@ -1147,3 +1161,15 @@ This also works with field name
1147
1161
"txtContent": "[$FieldName.displayValue]"
1148
1162
}
1149
1163
```
1164
+
1165
+
### "@isSelected"
1166
+
1167
+
This will evaluate to `true` for selected item(s) in a view and `false` otherwise.
1168
+
1169
+
### "@lcid"
1170
+
1171
+
This will evaluate to the LCID of current culture. This can be used to format the date, time and numbers.
1172
+
1173
+
### "@UIlcid"
1174
+
1175
+
This will evaluate to the LCID of current UI culture. This can be used to show localized display strings.
0 commit comments