SOLVED

Calculated Field Not Displaying in Form Custom Header

Iron Contributor

Good day.

As the title alludes, a calculated field and even an existing Information management label are not displaying in my form's custom header.

 

The Header JSON is as follows:

{
    "elmType": "div",
    "attributes": {
        "class": "ms-borderColor-neutralTertiary"
    },
    "style": {
        "width": "99%",
        "border-top-width": "0px",
        "border-bottom-width": "1px",
        "border-left-width": "0px",
        "border-right-width": "0px",
        "border-style": "solid",
        "margin-bottom": "16px",
        "background-color": "#0078d4"
    },
    "children": [
        {
            "elmType": "div",
            "style": {
                "display": "flex",
                "box-sizing": "border-box",
                "align-items": "center"
            },
            "children": [
                {
                    "elmType": "div",
                    "attributes": {
                        "iconName": "Certificate",
                        "class": "ms-fontSize-42 ms-fontWeight-regular ms-fontColor-themePrimary",
                        "title": "Details"
                    },
                    "style": {
                        "flex": "none",
                        "padding": "0px",
                        "padding-left": "10px",
                        "height": "36px",
                        "color": "white"
                    }
                }
            ]
        },
        {
            "elmType": "div",
            "attributes": {
                "class": "ms-fontColor-neutralSecondary ms-fontWeight-bold ms-fontSize-24"
            },
            "style": {
                "box-sizing": "border-box",
                "width": "100%",
                "text-align": "left",
                "padding": "21px 12px",
                "overflow": "hidden",
                "color": "white"
            },
            "children": [
                {
                    "elmType": "div",
                    "txtContent": "='Insurance Details for: ' + [$Title] + ' | Asset Label: ' +  [$AssetLabel] + [$Label]"
                }
            ]
        }
    ]
}

 

 You can see from the attached images those fields show up fine on the form but not the header. The rest of the JSON displays fine and I even added another field to prove my point, so the JSON works.

 

I looked it up and calculated fields are supported so I don't really see the issue other than it's not a Tuesday with a full moon.

 

Is there any reason why simple little things like this are a constant annoyance?? 

 

Thanks. Signed exasperated.

2 Replies
best response confirmed by Carl_Williams (Iron Contributor)
Solution

@Carl_Williams I have tested this from my end and I am able to reproduce this issue. I think this is a bug while using calculated column in JSON form formatting.

 

The calculated column value is available in the page context but it is not shown in form header: 

ganeshsanap_2-1678437938115.png

 I have raised a new bug/issue here: JSON Form formatting: Unable to use the calculated column value in header/footer layout customizatio.... Hopefully Microsoft will fix this in near future.

 

Similar thread: Get value of Name column from SPO list for JSON formatting in the header

 

As a workaround for now, you can try replicating same logic you used in calculated formula using JSON formatting in header layout.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Thanks ganeshanap! HOWEVER, been down this road way too many times in the past. I won't hold my breath on any microsoft alleged 'triage' of fixing anything. It'll probably fester for a couple of years where people will likely be forced to do, wait for it...............................hacks and workarounds.
We'll see though.
Thanks again.
1 best response

Accepted Solutions
best response confirmed by Carl_Williams (Iron Contributor)
Solution

@Carl_Williams I have tested this from my end and I am able to reproduce this issue. I think this is a bug while using calculated column in JSON form formatting.

 

The calculated column value is available in the page context but it is not shown in form header: 

ganeshsanap_2-1678437938115.png

 I have raised a new bug/issue here: JSON Form formatting: Unable to use the calculated column value in header/footer layout customizatio.... Hopefully Microsoft will fix this in near future.

 

Similar thread: Get value of Name column from SPO list for JSON formatting in the header

 

As a workaround for now, you can try replicating same logic you used in calculated formula using JSON formatting in header layout.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

View solution in original post