Skip to content

Commit 3ee1dc7

Browse files
Merge pull request SharePoint#8365 from shagra-ms/shagar/docs-update-august
Formatting docs update - August
2 parents 9d3a041 + ebdec63 commit 3ee1dc7

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

docs/declarative-customization/column-formatting.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use column formatting to customize SharePoint
33
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
55
ms.localizationpriority: high
66
---
77

@@ -707,6 +707,7 @@ The following column types support column formatting:
707707
* Average Rating
708708
* Likes
709709
* Approval Status
710+
* Attachments
710711

711712
The following are currently **not** supported:
712713

docs/declarative-customization/formatting-syntax-reference.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Formatting syntax reference
33
description: Formatting syntax reference
4-
ms.date: 08/03/2022
4+
ms.date: 08/12/2022
55
ms.localizationpriority: high
66
---
77

@@ -198,6 +198,12 @@ An optional property that specifies style attributes to apply to the element spe
198198
'--inline-editor-border-style'
199199
'--inline-editor-border-radius'
200200
'--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+
201207
```
202208

203209
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
278284

279285
## forEach
280286

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"`.
282288

283289
`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.
284290

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.
286292

287293
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.
288294

@@ -428,6 +434,8 @@ Values for `txtContent`, style properties, and attribute properties can be expre
428434

429435
Expressions can be written using Excel-style expressions in SharePoint Online, or by using Abstract Syntax Tree expressions in SharePoint Online and SharePoint 2019.
430436

437+
All fields in ViewFields can be referred in expresisons, even if it is marked `Explicit`.
438+
431439
### Excel-style expressions
432440

433441
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
544552
- startsWith
545553
- endsWith
546554
- replace
555+
- replaceAll
547556
- padStart
548557
- padEnd
549558
- getUserImage
550559
- addDays
551560
- addMinutes
552561
- appendTo
553562
- removeFrom
563+
- split
554564

555565
**Binary arithmetic operators** - The following are the standard arithmetic binary operators that expect two operands:
556566

@@ -645,6 +655,8 @@ Operators specify the type of operation to perform. The following operators are
645655
- **removeFrom**: returns an array with the given entry removed from the given array, if present
646656
- `"txtContent": "=removeFrom(@currentField, 'Choice 4')"` returns an array with 'Choice 4' removed from the @currentField array
647657
- `"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'
648660
- **addDays**: returns a datetime object with days added (or deducted) from the given datetime value
649661
- `"txtContent": "=addDays(Date('11/14/2021'), 3)"` returns a 11/17/2021, 12:00:00 AM
650662
- `"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
666678
- `"txtContent":"=replace('Hello world', 'world', 'everyone')"` results in _Hello everyone_
667679
- `"txtContent":"=replace([$MultiChoiceField], 'Choice 1', 'Choice 2')"` returns an array replacing Choice 1 with Choice 2
668680
- `"txtContent":"=replace([$MultiUserField], @me, '[email protected]')"` returns an array replacing @me with '[email protected]'
681+
- **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_
669683
- **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.
670684
- `"txtContent":"=padStart('DogFood', 10, 'A')"` results in _AAADogFood_
671685
- `"txtContent":"=padStart('DogFood', 10, 'AB')"` results in _ABADogFood_
@@ -1149,3 +1163,15 @@ This also works with field name
11491163
"txtContent": "[$FieldName.displayValue]"
11501164
}
11511165
```
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.

docs/declarative-customization/view-commandbar-formatting.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Command bar customization syntax reference
33
description: Command bar customization syntax reference
4-
ms.date: 06/28/2022
4+
ms.date: 08/12/2022
55
ms.localizationpriority: high
66
---
77

@@ -74,6 +74,7 @@ Mandatory property to uniquely identify a command in the Command bar. Valid keys
7474
'exportCSV'
7575
'export'
7676
'editInGridView'
77+
'exitGridView'
7778
'sync'
7879
'uploadTemplate'
7980
'addTemplate'

0 commit comments

Comments
 (0)