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
+29-27Lines changed: 29 additions & 27 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: 04/08/2023
4
+
ms.date: 04/03/2024
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -25,15 +25,17 @@ Any other value will result in an error.
25
25
26
26
### filepreview
27
27
28
-
Use the special elmType `filepreview` in conjunction with the `src` attribute set to [`@thumbnail.<Size>`](#thumbnails) to view thumbnails for files in your document libary.
29
-
If the thumbnail loads successfully, a small [brand type icon](https://developer.microsoft.com/fluentui#/styles/web/office-brand-icons) is visible on the bottom left. If the thumbanil fails to load (or if the file type doesn't support thumbnails), a [file type icon](https://developer.microsoft.com/fluentui#/styles/web/file-type-icons) is shown instead.
28
+
Use the special elmType `filepreview` in conjunction with the `src` attribute set to [`@thumbnail.<Size>`](#thumbnails) to view thumbnails for files in your document library.
29
+
30
+
If the thumbnail loads successfully, a small [brand type icon](https://developer.microsoft.com/fluentui#/styles/web/office-brand-icons) is visible on the bottom left. If the thumbnail fails to load (or if the file type doesn't support thumbnails), a [file type icon](https://developer.microsoft.com/fluentui#/styles/web/file-type-icons) is shown instead.
30
31
31
32
```json
32
33
"elmType": "filepreview",
33
34
"attributes": {
34
35
"src": "@thumbnail.medium"
35
36
}
36
37
```
38
+
37
39
### img src security
38
40
39
41
Images from the following domains are allowed:
@@ -293,11 +295,11 @@ An optional property that is meant for debugging. It outputs error messages and
293
295
294
296
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"`.
295
297
296
-
`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.
298
+
`iteratorName` represents the name of the 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 an underscore (`_`) that does not start with a digit.
297
299
298
-
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.
300
+
The field used in the loop must be in a supported field type with multi-value options enabled: Person, Lookup, and Choice. An expression returning an array can also be used.
299
301
300
-
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.
302
+
In the element with `forEach` or its children elements, the iterator variable can be referred to as if it is a new field. The index of the iterator can be accessed with `loopIndex` operator.
301
303
302
304
`forEach` cannot be applied to the root element, and will render no element if there is no value in the field.
303
305
@@ -371,19 +373,19 @@ Refer to this article for more information about how to allow list domains - htt
371
373
Note - This action is only available in the newer version of the Microsoft Lists App.
"txtContent": "Click here to open recipe video 👩🍳"
388
+
}
387
389
```
388
390
389
391
The `actionParams` attribute can have the following options when using the `executeFlow` action:
@@ -394,26 +396,26 @@ The `actionParams` attribute can have the following options when using the `exec
394
396
395
397
## customCardProps
396
398
397
-
Add a custom card to the element, that shows up on hover or click event. Following customization is available -
399
+
Add a custom card to the element, that shows up on hover or click event. The following customization is available -
398
400
399
401
- `"formatter"`: JSON object that defines formatting for custom cards.
400
402
- `"openOnEvent"`: Event on which the customCard should open.
401
403
- Valid values: `click`, `hover`
402
-
- `"directionalHint"`: Specify the direction relative to the target in which custom card will be positioned. This is the preferred ___location but is not guaranteed depending on space.
404
+
- `"directionalHint"`: Specify the direction relative to the target in which the custom card will be positioned. This is the preferred ___location but is not guaranteed depending on space.
- `"isBeakVisible"`: Specify if the beak is to be shown or not.
405
407
- `"beakStyle"`: Specifies the style object for custom card's beak.
406
408
407
409
## defaultHoverField
408
410
409
-
Adds the profile card for the people fields or file hover card for files in document library.
411
+
Adds the profile card for the people fields or file hovercard for files in the document library.
410
412
411
413
- `"defaultHoverField": "[$Editor]"` adds a profile card for the editor field
412
414
- `"defaultHoverField": "[$FileLeafRef]"` adds a file hover card in documentLibrary
413
415
414
416
## columnFormatterReference
415
417
416
-
This will be replaced with the referenced column's formatter JSON. Multilevel reference is not supported.
418
+
This will be replaced with the referenced column's formatter JSON. Multi-level reference is not supported.
417
419
418
420
```JSON
419
421
{
@@ -459,11 +461,11 @@ An optional property, that allows overriding the default styles of file type ico
459
461
460
462
## Expressions
461
463
462
-
Values for `txtContent`, style properties, and attribute properties can be expressed as expressions, so that they are evaluated at runtime based on the context of the current field (or row). Expression objects can be nested to contain other Expression objects.
464
+
Values for `txtContent`, style properties, and attribute properties can be expressed as expressions so that they are evaluated at runtime based on the context of the current field (or row). Expression objects can be nested to contain other Expression objects.
463
465
464
466
Expressions can be written using Excel-style expressions in SharePoint Online and SharePoint Server Subscription Edition starting with the Version 22H2 feature update, or by using Abstract Syntax Tree expressions in SharePoint Online, SharePoint Server Subscription Edition, and SharePoint Server 2019.
465
467
466
-
All fields in ViewFields can be referred in expresisons, even if it is marked `Explicit`.
468
+
All fields in ViewFields can be referred in expressions, even if it is marked `Explicit`.
467
469
468
470
### Excel-style expressions
469
471
@@ -705,11 +707,11 @@ Operators specify the type of operation to perform. The following operators are
705
707
706
708
The substring() method returns the part of the string between the start and end indexes, or to the end of the string.
707
709
708
-
-**replace**: searches a string (or array) for a specified value and returns a new string (or array) where the specified value is replaced. Incase of string, only the first instance of the value will be replaced.
710
+
-**replace**: searches a string (or array) for a specified value and returns a new string (or array) where the specified value is replaced. In case of string, only the first instance of the value will be replaced.
709
711
-`"txtContent":"=replace('Hello world', 'world', 'everyone')"` results in _Hello everyone_
710
712
-`"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. Incase of string, all instances of the value will be replaced.
714
+
-**replaceAll**: searches a string for a specified value and returns a new string (or array) where the specified value is replaced. In case of string, all instances of the value will be replaced.
713
715
-`"txtContent":"=replaceAll('H-e-l-l-o W-o-r-l-d', '-', '')"` results in _Hello World_
714
716
-**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.
715
717
-`"txtContent":"=padStart('DogFood', 10, 'A')"` results in _AAADogFood_
0 commit comments