I'm formatting the view of an entire list using JSON.
Using the following code, the date modified and editor are not visible.
{"elmType": "span","txtContent": "[$Editor]"}
Same problem with [$Modified]
I'm formatting the view of an entire list using JSON.
Using the following code, the date modified and editor are not visible.
{"elmType": "span","txtContent": "[$Editor]"}
Same problem with [$Modified]
Try this JSON for test (it is working for me):
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"attributes": {
"class": "sp-row-card"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "sp-row-title"
},
"txtContent": "[$Modified]"
},
{
"elmType": "div",
"attributes": {
"class": "sp-row-title"
},
"txtContent": "[$Editor.email]"
}
]
}
}
Note:
In order to access the Modified By and Modified columns in JSON, it should be included in the list view.
You can include the column in list view from view settings like:
official documentations:
The people field object has the following properties (with example values):
{
"id": "122",
"title": "Kalya Tucker",
"email": "[email protected]",
"sip": "[email protected]",
"picture": "https://contoso.sharepoint.com/kaylat_contoso_com_MThumb.jpg?t=63576928822",
"department":"Human Resources",
"jobTitle":"HR Manager"
}
Also, to convert the date columns in other formats, you can use toLocaleDateString() or toLocaleString() functions.