0

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]

1
  • Do you show Modilfied by in the view?
    – Amos
    Commented Oct 13, 2020 at 7:29

2 Answers 2

0

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:

enter image description here

official documentations:

  1. Use view formatting to customize SharePoint
  2. Use column formatting to customize SharePoint - You can find supported functions and guidelines for JSON formatting in this link

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.

1

You could try to use:[$Editor.title] to show the editor name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.