Skip to content

Commit 75ca995

Browse files
Merge pull request SharePoint#7627 from shagra-ms/shagra/docs-update-01-2021
Formatting documentation fixes
2 parents 7e0ca81 + 0d68074 commit 75ca995

File tree

2 files changed

+423
-406
lines changed

2 files changed

+423
-406
lines changed

docs/declarative-customization/formatting-advanced.md

Lines changed: 109 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Advanced formatting concepts
33
description: Advanced formatting concepts
4-
ms.date: 12/12/2021
4+
ms.date: 01/06/2022
55
ms.localizationpriority: high
66
---
77
# Advanced formatting concepts
@@ -20,19 +20,19 @@ To use the sample below, you must substitute the ID of the Flow you want to run.
2020

2121
To obtain the ID of a flow that is solution-aware:
2222

23-
1. Choose Flow > See your flows in the SharePoint list where the Flow is configured.
24-
2. If applicable, [switch to the environment](/power-platform/admin/working-with-environments#switch-the-environment) in which the Flow is hosted.
25-
3. Choose the Solutions area.
26-
4. Choose the solution in which the Flow was created.
27-
5. Filter for Cloud flows and select the Flow you want to run.
28-
6. Choose Export > Get flow identifier.
29-
7. Copy the ID.
23+
1. Select **Flow > See your flows** in the SharePoint list where the Flow is configured.
24+
1. If applicable, [switch to the environment](/power-platform/admin/working-with-environments#switch-the-environment) in which the Flow is hosted.
25+
1. Select the Solutions area.
26+
1. Select the solution in which the Flow was created.
27+
1. Filter for Cloud flows and select the Flow you want to run.
28+
1. Select Export > Get flow identifier.
29+
1. Copy the ID.
3030

3131
To obtain the ID of a flow that is not solution-aware:
3232

33-
1. Choose Flow > See your flows in the SharePoint list where the Flow is configured.
34-
2. Choose the Flow you want to run.
35-
3. Copy the ID from the end of the URL.
33+
1. Select **Flow > See your flows** in the SharePoint list where the Flow is configured.
34+
1. Select the Flow you want to run.
35+
1. Copy the ID from the end of the URL.
3636

3737
```JSON
3838
{
@@ -69,92 +69,91 @@ To obtain the ID of a flow that is not solution-aware:
6969
```
7070

7171
Additionally, you can use `headerText` and `runFlowButtonText` options within the `actionParams` property to customize portions of the Flow panel itself! See the [button elements](./formatting-syntax-reference.md#customrowaction) portion of the Detailed syntax reference for more details.
72-
## Custom cards on hover
72+
73+
## Custom cards on hover
7374

7475
The following image shows a list with a custom hover added to a List:
7576

76-
On hover - Metadata on the column "Status" is made available in view formatting
77+
On hover - Metadata on the column "Status" is made available in view formatting:
7778

7879
![Preview Image 1](../images/HoverImage-1.png)
7980

80-
On hover - Metadata on the column "Status" is made available in column formatting
81+
On hover - Metadata on the column "Status" is made available in column formatting:
8182

8283
![Preview Image 2](../images/HoverImage-2.png)
8384

85+
You can use formatting to define custom call out that can be commissioned basis user defined actions like click or hover.
8486

85-
86-
You can use formatting to define custom call out that can be commissioned basis user defined actions like click or hover
87-
88-
This example uses customCardProps, openOnEvent, directionalHint and isBeakVisible
87+
This example uses `customCardProps`, `openOnEvent`, `directionalHint` and `isBeakVisible`:
8988

9089
```JSON
9190
{
92-
"elmType": "div",
93-
"style": {
94-
"font-size": "12px"
91+
"elmType": "div",
92+
"style": {
93+
"font-size": "12px"
94+
},
95+
"txtContent": "[$Status]",
96+
"customCardProps": {
97+
"formatter": {
98+
"elmType": "div",
99+
"txtContent": "Define your formatter options inside the customCarProps/formatter property"
95100
},
96-
"txtContent": "[$Status]",
97-
"customCardProps": {
98-
"formatter": {
99-
"elmType": "div",
100-
"txtContent": "Define your formatter options inside the customCarProps/formatter property"
101-
},
102-
"openOnEvent": "hover",
103-
"directionalHint": "bottomCenter",
104-
"isBeakVisible": true,
105-
"beakStyle" : {
106-
"backgroundColor": "white"
107-
}
101+
"openOnEvent": "hover",
102+
"directionalHint": "bottomCenter",
103+
"isBeakVisible": true,
104+
"beakStyle" : {
105+
"backgroundColor": "white"
108106
}
107+
}
109108
}
110109
```
111110

112111
## Default cards on hover
113112

114-
Users can now have profile card or file hover card on formatters too, some of the things users can now do -
115-
1) Profile card or File Hover card on any column
116-
2) Profile card or Hover card with view formatting
113+
Users can now have profile card or file hover card on formatters too, some of the things users can now do:
117114

118-
Hover on a filename with formatting with default file card
115+
1. Profile card or File Hover card on any column
116+
1. Profile card or Hover card with view formatting
119117

120-
![Preview Image 3](../images/HoverImage-3.png)
118+
Hover on a filename with formatting with default file card:
121119

120+
![Preview Image 3](../images/HoverImage-3.png)
122121

123-
Hover on a person column with formatting with default Profile card
122+
Hover on a person column with formatting with default Profile card:
124123

125124
![Preview Image 4](../images/HoverImage-4.png)
126125

127-
Both the example uses defaultHoverField
126+
Both the example uses defaultHoverField
128127

129128
```JSON
130129
{
131-
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
132-
"elmType": "div",
133-
"children": [
134-
{
135-
"elmType": "img",
136-
"style": {
137-
"width": "32px",
138-
"height": "32px",
139-
"overflow": "hidden",
140-
"border-radius": "50%",
141-
"margin": "2px"
142-
},
143-
"attributes": {
144-
"src": "=getUserImage([$Editor.email], 's')",
145-
"title": "[$Editor.title]"
146-
}
147-
},
148-
{
149-
"elmType": "span",
150-
"style": {
151-
"vertical-align": "middle",
152-
"margin-left": "2px"
153-
},
154-
"txtContent": "[$Editor.title]"
155-
}
156-
],
157-
"defaultHoverField": "[$Editor]"
130+
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
131+
"elmType": "div",
132+
"children": [
133+
{
134+
"elmType": "img",
135+
"style": {
136+
"width": "32px",
137+
"height": "32px",
138+
"overflow": "hidden",
139+
"border-radius": "50%",
140+
"margin": "2px"
141+
},
142+
"attributes": {
143+
"src": "=getUserImage([$Editor.email], 's')",
144+
"title": "[$Editor.title]"
145+
}
146+
},
147+
{
148+
"elmType": "span",
149+
"style": {
150+
"vertical-align": "middle",
151+
"margin-left": "2px"
152+
},
153+
"txtContent": "[$Editor.title]"
154+
}
155+
],
156+
"defaultHoverField": "[$Editor]"
158157
}
159158
```
160159

@@ -254,9 +253,10 @@ The following image shows a list with a Gallery layout referencing the Category
254253
}
255254
}
256255
```
256+
257257
## Inline Editing
258258

259-
With inline editing, formatters have the ability to load field editors to edit field data on an item.
259+
With inline editing, formatters have the ability to load field editors to edit field data on an item.
260260
Users need to have edit permissions on the list item and the field type should belong to set of supported types for this feature to work.
261261

262262
A special json property `inlineEditField` is used with value as the field internal name __`[$FieldName]`__ at the target element in the json.
@@ -268,14 +268,15 @@ A special json property `inlineEditField` is used with value as the field intern
268268
"txtContent": "[$FieldName]"
269269
}
270270
```
271-
<br />
272271

273272
![Inline Editing using inlineEditField property](../images/sp-columnformatting-inline-editing.gif)
274273

275274
This allows the users to edit items in-place, within the view, without navigating away to grid based editing or to a item edit form.
276275

277276
### Supported Field Types
278-
List of supported field types for inline editing
277+
278+
List of supported field types for inline editing:
279+
279280
- Single line text
280281
- Multi line text (without RTF)
281282
- Number
@@ -285,7 +286,8 @@ List of supported field types for inline editing
285286
- Lookup
286287

287288
### Hover Borders and Customizations
288-
The inline editing adds a hover border on the elements to indicate these elements have an associated action. The default border is `neutralSecondary` , and on click, the editor appears with a `themePrimary` border. These border colors can be overriden via setting style on the same element with `inlineEditField` by using some special attributes - `--inline-editor-border-width`, `--inline-editor-border-style`, `--inline-editor-border-radius` and `--inline-editor-border-color`.
289+
290+
The inline editing adds a hover border on the elements to indicate these elements have an associated action. The default border is `neutralSecondary` , and on click, the editor appears with a `themePrimary` border. These border colors can be overriden via setting style on the same element with `inlineEditField` by using some special attributes - `--inline-editor-border-width`, `--inline-editor-border-style`, `--inline-editor-border-radius`, and `--inline-editor-border-color`.
289291

290292
```json
291293
{
@@ -303,9 +305,9 @@ The inline editing adds a hover border on the elements to indicate these element
303305

304306
## Set multiple field values of an Item using customRowAction
305307

306-
With the new `setValue` `customRowAction`, formatters can render action buttons which modify the item internally without opening editors or forms. `setValue` also allows setting multiple field values of the item at once.
308+
With the new `setValue` and `customRowAction` properties, formatters can render action buttons which modify the item internally without opening editors or forms. `setValue` also allows setting multiple field values of the item at once.
307309

308-
The below JSON will set value of `FieldInternalName_1`, `FieldInternalName_2` and `FieldInternalName_3`with the values provided.
310+
The below JSON will set value of `FieldInternalName_1`, `FieldInternalName_2`, and `FieldInternalName_3`with the values provided:
309311

310312
```json
311313
{
@@ -323,37 +325,47 @@ The below JSON will set value of `FieldInternalName_1`, `FieldInternalName_2` an
323325
```
324326

325327
### Supported Field Types
328+
326329
- Single line text
327330
- Multi line text (without RTF)
328331
- Number
329332
- DateTime
330333
- Choice and MultiChoice
331334
- User and Multi user
332335

333-
### Value Field values in `actionInput` :
334-
- Text values:
335-
- a valid string like `"Choice 1"`
336-
- value from other columns : `[$ColumnName]`
337-
- an [expression](./formatting-syntax-reference.md#expressions) like <br>
338-
`"if([$column]> 10, "Choice A", "Choice B")"` <br>
336+
### Value Field values in `actionInput`:
337+
338+
- Text values:
339+
- a valid string like `"Choice 1"`
340+
- value from other columns : `[$ColumnName]`
341+
- an [expression](./formatting-syntax-reference.md#expressions) such as:
342+
343+
`"if([$column]> 10, "Choice A", "Choice B")"`
344+
339345
or
346+
340347
`{operator: "+", operands" : ["Choice", "A"]}`
341-
- Number:
342-
- a valid number
343-
- value from other columns : `[$ColumnName]`
344-
- an [expression](./formatting-syntax-reference.md#expressions)
345-
- Date values :
346-
- a date string
347-
- `@now` token
348-
- [expressions](./formatting-syntax-reference.md#expressions) which return a date using builtin date functions
349-
- `addDays` and `addMinutes`, two new functions to support [expressions](./formatting-syntax-reference.md#expressions) like 7 days from today
350-
- Multi-Choice and Multi-Person:
351-
Multi value fields are special, as they need an array value to save multiple values.
352-
- `appendTo` and `removeFrom`, two new functions which operate on multivalue fields.
353-
- `appendTo([$MultiChoiceField], 'MyValue')`
354-
- Person field values:
355-
- User Name or Email
356-
- an [expression](./formatting-syntax-reference.md#expressions) which returns these values
357-
> [!NOTE]
358-
> A query runs with the string value provided on people column and the first person in the returned results is used
359348

349+
- Number:
350+
- a valid number
351+
- value from other columns : `[$ColumnName]`
352+
- an [expression](./formatting-syntax-reference.md#expressions)
353+
- Date values:
354+
- a date string
355+
- `@now` token
356+
- [expressions](./formatting-syntax-reference.md#expressions) which return a date using builtin date functions
357+
- `addDays` and `addMinutes`, two new functions to support [expressions](./formatting-syntax-reference.md#expressions) like 7 days from today
358+
- an empty string `""` clears the field value
359+
- Multi-Choice and Multi-Person:
360+
- Multi value fields are special, as they need an array value to save multiple values.
361+
- `appendTo`, `removeFrom`, and `replace`, three functions which can operate on multivalue fields.
362+
- `appendTo([$MultiChoiceField], 'MyValue')`
363+
- `removeFrom([$MultiUserField], @me)`: removes all occurrences that match the second parameter
364+
- `replace([$MultiChoiceField], 'Choice 1', 'Choice 3')`: replaces all occurrences of second parameter with third.
365+
- Person field values:
366+
- user name or email
367+
- An empty string `""` clears the field value
368+
- an [expression](./formatting-syntax-reference.md#expressions) which returns these values
369+
370+
> [!NOTE]
371+
> A query runs with the string value provided on people column and the first person in the returned results is used.

0 commit comments

Comments
 (0)