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/column-formatting.md
+47-5Lines changed: 47 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Use column formatting to customize SharePoint
3
3
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: 08/21/2019
4
+
ms.date: 10/26/2020
5
5
localization_priority: Priority
6
6
---
7
7
@@ -826,11 +826,11 @@ The following column types support column formatting:
826
826
* Choice
827
827
* ContentType
828
828
* Counter (ID)
829
-
* Currency*
829
+
* Currency
830
830
* Date/Time
831
831
* Hyperlink
832
832
* Image
833
-
* Location*
833
+
* Location
834
834
* Lookup
835
835
* Multi-Choice
836
836
* Multi-Line Text
@@ -842,8 +842,6 @@ The following column types support column formatting:
842
842
* Title (in Lists)
843
843
* Yes/No
844
844
845
-
_* Formats for these column types can only be applied through Field Settings_
846
-
847
845
The following are currently **not** supported:
848
846
849
847
* Managed Metadata
@@ -1184,6 +1182,8 @@ An optional property that specifies additional attributes to add to the element
1184
1182
- d
1185
1183
- aria
1186
1184
- data-interception
1185
+
- viewBox
1186
+
- preserveAspectRatio
1187
1187
1188
1188
Any other attribute name will result in an error. Attribute values can either be Expression objects or strings. The following example adds two attributes (`target` and `href`) to the element specified by `elmType`. The `target` attribute is hard-coded to a string. The `href` attribute is an expression that will be evaluated at runtime to http://finance.yahoo.com/quote/ + the value of the current field (`@currentField`).
1189
1189
@@ -1688,12 +1688,53 @@ The following example shows how a hyperlink field might be used on a current fie
1688
1688
}
1689
1689
```
1690
1690
1691
+
**Image fields**
1692
+
1693
+
The image field object has the following properties (with example values):
The column is formatted within the context of the entire row. You can use this context to reference the values of other fields within the same row by specifying the **internal name** of the field surrounded by square brackets and preceded by a dollar sign: `[$InternalName]`. For example, to get the value of a field with an internal name of "MarchSales", use `[$MarchSales]`.
1694
1728
1695
1729
If the value of a field is an object, the object's properties can be accessed. For example, to access the "Title" property of a person field named "SalesLead", use "[$SalesLead.title]".
1696
1730
1731
+
#### "[!FieldName]"
1732
+
1733
+
In column and view formatting, you can refer to any field's metadata by specifying the **internal name** of the field surrounded by square brackets and preceded by a exclamation mark: `[!InternalName]`.
1734
+
1735
+
Currently field's display name is available in this metadata, and can be accessed using DisplayName property: `[!SalesLead.DisplayName]`.
1736
+
1737
+
1697
1738
#### "@currentWeb"
1698
1739
1699
1740
This will evaluate to the absolute URL for the site. This is equivalent to the `webAbsoluteUrl` value within the page context. This value is only available in SharePoint Online.
@@ -1819,6 +1860,7 @@ The following column types can use displayValue property to get the default rend
0 commit comments