Skip to content

Commit 791da99

Browse files
committed
Multiple feature updates
1 parent 3189048 commit 791da99

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

docs/declarative-customization/column-formatting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -643,6 +653,8 @@ Operators specify the type of operation to perform. The following operators are
643653
- **removeFrom**: returns an array with the given entry removed from the given array, if present
644654
- `"txtContent": "=removeFrom(@currentField, 'Choice 4')"` returns an array with 'Choice 4' removed from the @currentField array
645655
- `"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'
646658
- **addDays**: returns a datetime object with days added (or deducted) from the given datetime value
647659
- `"txtContent": "=addDays(Date('11/14/2021'), 3)"` returns a 11/17/2021, 12:00:00 AM
648660
- `"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
664676
- `"txtContent":"=replace('Hello world', 'world', 'everyone')"` results in _Hello everyone_
665677
- `"txtContent":"=replace([$MultiChoiceField], 'Choice 1', 'Choice 2')"` returns an array replacing Choice 1 with Choice 2
666678
- `"txtContent":"=replace([$MultiUserField], @me, '[email protected]')"` returns an array replacing @me with '[email protected]'
679+
- **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_
667681
- **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.
668682
- `"txtContent":"=padStart('DogFood', 10, 'A')"` results in _AAADogFood_
669683
- `"txtContent":"=padStart('DogFood', 10, 'AB')"` results in _ABADogFood_
@@ -1147,3 +1161,15 @@ This also works with field name
11471161
"txtContent": "[$FieldName.displayValue]"
11481162
}
11491163
```
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.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)