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
+36-14Lines changed: 36 additions & 14 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
@@ -366,6 +368,26 @@ See [here](./column-formatting.md#formatting-multi-value-fields) for examples.
366
368
}
367
369
```
368
370
371
+
- **embed**: Clicking on the button will open a callout with content embedded in it. The content will be determined by the URL provided in the `src` attribute in `actionInput`. You can also control the `height` and `width` of the callout using the actionInput. Note that the src has to be just the url part of an embeddable code generated by an app.\
372
+
Refer to this article for more information about how to allow list domains - https://go.microsoft.com/fwlink/p/?linkid=2258033.\
373
+
Note - This action is only available in the newer version of the Microsoft Lists App.
"txtContent": "Click here to open recipe video 👩🍳"
388
+
}
389
+
```
390
+
369
391
The `actionParams` attribute can have the following options when using the `executeFlow` action:
370
392
371
393
- **id**: ID of the Flow to launch _(required)_
@@ -374,26 +396,26 @@ The `actionParams` attribute can have the following options when using the `exec
374
396
375
397
## customCardProps
376
398
377
-
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 -
378
400
379
401
- `"formatter"`: JSON object that defines formatting for custom cards.
380
402
- `"openOnEvent"`: Event on which the customCard should open.
381
403
- Valid values: `click`, `hover`
382
-
- `"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.
385
407
- `"beakStyle"`: Specifies the style object for custom card's beak.
386
408
387
409
## defaultHoverField
388
410
389
-
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.
390
412
391
413
- `"defaultHoverField": "[$Editor]"` adds a profile card for the editor field
392
414
- `"defaultHoverField": "[$FileLeafRef]"` adds a file hover card in documentLibrary
393
415
394
416
## columnFormatterReference
395
417
396
-
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.
397
419
398
420
```JSON
399
421
{
@@ -439,11 +461,11 @@ An optional property, that allows overriding the default styles of file type ico
439
461
440
462
## Expressions
441
463
442
-
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.
443
465
444
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.
445
467
446
-
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`.
447
469
448
470
### Excel-style expressions
449
471
@@ -685,11 +707,11 @@ Operators specify the type of operation to perform. The following operators are
685
707
686
708
The substring() method returns the part of the string between the start and end indexes, or to the end of the string.
687
709
688
-
-**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.
689
711
-`"txtContent":"=replace('Hello world', 'world', 'everyone')"` results in _Hello everyone_
690
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.
693
715
-`"txtContent":"=replaceAll('H-e-l-l-o W-o-r-l-d', '-', '')"` results in _Hello World_
694
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.
695
717
-`"txtContent":"=padStart('DogFood', 10, 'A')"` results in _AAADogFood_
0 commit comments