Forum Discussion

leonardbd's avatar
leonardbd
Copper Contributor
Sep 04, 2023
Solved

SP List Header - New Item shows user display name at Adding or Editing item

Hi There, I have a SP list that has a user directory pickup filed "requestor". I have updated the header which should Show "Request of: Leonard Jackson" at the Header when Add or Edit any data in th...
  • ganeshsanap's avatar
    Sep 04, 2023

    leonardbd Use .title instead of .DisplayName. I just tested and it is working fine for me. Also, make sure you are using correct internal name of your people picker column in JSON. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?  

     

    {
        "elmType": "div",
        "attributes": {
            "class": "ms-bgColor-green"
        },
        "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"
        },
        "children": [
            {
                "elmType": "div",
                "style": {
                    "display": "flex",
                    "box-sizing": "border-box",
                    "align-items": "center"
                },
                "children": [
                    {
                        "elmType": "div",
                        "attributes": {
                            "iconName": "MobileSelected",
                            "class": "ms-fontSize-42 ms-fontWeight-regular  ms-fontColor-white",
                            "title": "Software Name"
                        },
                        "style": {
                            "flex": "none",
                            "padding": "0px",
                            "padding-left": "0px",
                            "height": "36px"
                        }
                    }
                ]
            },
            {
                "elmType": "div",
                "attributes": {
                    "class": "ms-fontColor-white ms-fontWeight-bold ms-fontSize-24"
                },
                "style": {
                    "box-sizing": "border-box",
                    "width": "100%",
                    "text-align": "left",
                    "padding": "21px 12px",
                    "overflow": "hidden"
                },
                "children": [
                    {
                        "elmType": "div",
                        "txtContent": "=if ([$Title] == '', 'New Item', 'Request of: ' + [$Requestor.title])"
                    }
                ]
            }
        ]
    }

     


    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.

Resources