Skip to content

Commit 44a7436

Browse files
committed
Image field sample update
1 parent 58e8cd5 commit 44a7436

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/declarative-customization/column-formatting.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,40 @@ The following example shows how a hyperlink field might be used on a current fie
16881688
}
16891689
```
16901690

1691+
**Image fields**
1692+
1693+
The image field object has the following properties (with example values):
1694+
1695+
```JSON
1696+
{
1697+
"fileName": "image.png",
1698+
"id": "6bb1d843-0633-4c9a-9a16-90bc5abd1d8e",
1699+
"serverRelativeUrl": "/teams/Discovery/SiteAssets/Lists/ad6ed939-0db2-4d85-8a39-8f3497f41eee/image.png",
1700+
"serverUrl": "https://contoso.sharepoint.com"
1701+
}
1702+
1703+
```
1704+
1705+
<br/>
1706+
1707+
The following example shows how a lookup field might be used on a current field.
1708+
1709+
```JSON
1710+
{
1711+
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
1712+
"elmType": "img",
1713+
"attributes": {
1714+
"src": "@currentField.serverRelativeUrl",
1715+
"alt": "@currentField.fileName"
1716+
},
1717+
"style": {
1718+
"width": "100%",
1719+
"max-width": "100%"
1720+
}
1721+
}
1722+
```
1723+
1724+
16911725
#### "[$FieldName]"
16921726

16931727
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]`.

0 commit comments

Comments
 (0)