I'm trying to get the filename of a document name displayed in the header (form header using json formatting).

I tried the below using both $Name and $FileLeafRef but no luck:

        "elmType": "div",
        "txtContent": "[$Name]"

It says it works here but maybe its being used in the body or something else. I need it in the header

Thanks in Advance

1 Answer 1


This is a known issue of form JSON formatting. I have also observed this issue while formatting header layout in properties form of SharePoint document library.

Using [$FileLeafRef] resulting in blank value even when it is available in page context:

enter image description here

Reference: Form formatting: In header section [$FileLeafRef], [$FileRef] coming blank

However, by default when you open document library properties form, it shows document name at the top (SharePoint default functionality):

enter image description here

  • Yes correct Ganesh. I think i will just use title and use power automate to update the title field
    – naijacoder
    Commented Feb 12, 2023 at 8:39
  • Yes, for workaround you have to use the Power Automate to update title field. Note: Unfortunately you cannot use "Name" column in calculated column formula as well. Commented Feb 12, 2023 at 14:13

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.