Skip to content

Commit 87f596e

Browse files
thechriskentVesaJuvonen
authored andcommitted
Updated Supported Columns & Location Values (SharePoint#4519)
1 parent b4f86b5 commit 87f596e

File tree

1 file changed

+85
-13
lines changed

1 file changed

+85
-13
lines changed

docs/declarative-customization/column-formatting.md

Lines changed: 85 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -717,24 +717,32 @@ This examples uses operator `loopIndex` to control the margins all rows but the
717717

718718
The following column types support column formatting:
719719

720-
* Single line of text
721-
* Number
720+
* Calculated
722721
* Choice
723-
* Person or Group
724-
* Yes/No
725-
* Hyperlink
726-
* Picture
722+
* ContentType
723+
* Counter (ID)
724+
* Currency*
727725
* Date/Time
726+
* Hyperlink
727+
* Location*
728728
* Lookup
729+
* Multi-Choice
730+
* Multi-Line Text
731+
* Multi-Person
732+
* Number
733+
* Person or Group
734+
* Picture
735+
* Single line of text
729736
* Title (in Lists)
737+
* Yes/No
738+
739+
_* Formats for these column types can only be applied through Field Settings_
730740

731-
The following are not currently supported:
741+
The following are currently **not** supported:
732742

733743
* Managed Metadata
734744
* Filename (in Document Libraries)
735-
* Calculated
736745
* Retention Label
737-
* Currency
738746

739747
## Style guidelines
740748

@@ -1257,7 +1265,7 @@ Operators specify the type of operation to perform. The following operators are
12571265
- `"txtContent":"=length(45)"` results in _1_
12581266
- `"txtContent":"=length(0)"` results in _0_
12591267

1260-
- **floor**: returns the largest integer les than or equal to a given number. - _Only available in SharePoint Online_
1268+
- **floor**: returns the largest integer less than or equal to a given number. - _Only available in SharePoint Online_
12611269
- `"txtContent":"=floor(45.5)"` results in _45_
12621270

12631271
- **ceiling**: rounds the given number up to the next largest whole number or integer. - _Only available in SharePoint Online_
@@ -1331,7 +1339,7 @@ The values for `txtContent`, styles, and attributes can be either strings or Exp
13311339

13321340
Will evaluate to the value of the current field.
13331341

1334-
Some field types are represented as objects. To output a value from an object, refer to a particular property inside that object. For example, if the current field is a person/group field, specify `@currentField.title` to retrieve the person's name, which is normally displayed in list views. The following are the field types that are represented as objects with a list their properties.
1342+
Some field types are represented as objects. To output a value from an object, refer to a particular property inside that object. For example, if the current field is a person/group field, specify `@currentField.title` to retrieve the person's name, which is normally displayed in list views. The following are the field types that are represented as objects with a list of their properties.
13351343

13361344
> [!NOTE]
13371345
> The `@currentField.title` returns a person's name by default. However, if the person field's Show Field has been adjusted, it may change the value of the `title` property. For example, a person field with the Show Field configured as Department will have the person's department for the `title` property.
@@ -1346,8 +1354,8 @@ The people field object has the following properties (with example values):
13461354
"title": "Kalya Tucker",
13471355
"email": "[email protected]",
13481356
1349-
"picture": "https://contoso.sharepoint.com/kaylat_contoso_com_MThumb.jpg?t=63576928822",
1350-
"department":"Human Resources",
1357+
"picture": "https://contoso.sharepoint.com/kaylat_contoso_com_MThumb.jpg?t=63576928822",
1358+
"department":"Human Resources",
13511359
"jobTitle":"HR Manager"
13521360
}
13531361
```
@@ -1382,6 +1390,70 @@ Here's the same sample from above, using the Excel-style expression syntax:
13821390
}
13831391
```
13841392

1393+
**Location fields**
1394+
1395+
The ___location field object has the following properties (with example values):
1396+
1397+
```JSON
1398+
{
1399+
"Address": {
1400+
"City": "Knoxville",
1401+
"CountryOrRegion": "United States",
1402+
"State": "TN",
1403+
"Street": "963 Worlds Fair Park Dr"
1404+
},
1405+
"Coordinates": {
1406+
"Latitude": "35.961673736572266",
1407+
"Longitude": "-83.92420959472656"
1408+
},
1409+
"DisplayName": "World's Fair Park",
1410+
"LocationUri: "https://www.bingapis.com/api/v6/localentities/8346bf26-6da4-104c-6ba5-2334b83f6ac8?setLang=en"
1411+
}
1412+
```
1413+
1414+
> [!NOTE] Location fields do not currently have a "Format this column" option in the list view and formats applied directly to these fields will need to be done through field settings.
1415+
1416+
<br/>
1417+
1418+
The following example shows how a ___location field might be used on a current field.
1419+
1420+
```JSON
1421+
{
1422+
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
1423+
"elmType": "div",
1424+
"style": {
1425+
"display": "block"
1426+
},
1427+
"children": [
1428+
{
1429+
"elmType": "a",
1430+
"txtContent": "@currentField.DisplayName",
1431+
"attributes": {
1432+
"href": "='https://www.bing.com/maps?cp=' + @currentField.Coordinates.Latitude + '~' + @currentField.Coordinates.Longitude + '&lvl=17&sV=2'",
1433+
"target": "_blank",
1434+
"title": "[email protected] + ', ' + @currentField.Coordinates.Longitude"
1435+
},
1436+
"style": {
1437+
"display": "block"
1438+
}
1439+
},
1440+
{
1441+
"elmType": "div",
1442+
"txtContent": "@currentField.Address.Street"
1443+
},
1444+
{
1445+
"elmType": "div",
1446+
"txtContent": "[email protected] + ', ' + @currentField.Address.State"
1447+
},
1448+
{
1449+
"elmType": "div",
1450+
"txtContent": "@currentField.Address.CountryOrRegion"
1451+
}
1452+
]
1453+
}
1454+
```
1455+
1456+
13851457
**Lookup fields**
13861458

13871459
The lookup field object has the following properties (with example values):

0 commit comments

Comments
 (0)