Forum Discussion

wit4r7's avatar
wit4r7
Brass Contributor
Apr 29, 2020
Solved

View Formatting - Can't display People Field

Hey, I'm creating a custom view for a list with JSON. So far everything works fine, with one excaption. I'm not able to display the information from a people field.   My Field has the name "Dire...
  • Sudharsan K's avatar
    May 03, 2020

    wit4r7 

    In the below code from your post the 'Director' div you have given the txtcontent directly, for the Project Manager, you have given [$ProjectManager.Title], it should be lowercase title. Can you please correct the json and try, instead of trying with the whole json, just try to use only 'Director' and 'Project Manager' field for testing and then you can append the rest of the code, since it is working fine.

     

    {
                        "elmType": "div",
                        "txtContent": "Director:",
                        "style": {
                          "display": "block"
                        },
                        "attributes": {
                          "class": "ms-fontWeight-semibold ms-fontColor-neutralPrimary"
                        }
                      },
                      {
                        "elmType": "div",
                        "txtContent": "Hier könnte Ihr Name stehen",
                        "defaultHoverField": "[$Director]",
                        "style": {
                          "display": "block"
                        }
                      },
                      {
                        "elmType": "div",
                        "txtContent": "Project Manager:",
                        "style": {
                          "display": "block"
                        },
                        "attributes": {
                          "class": "ms-fontWeight-semibold ms-fontColor-neutralPrimary"
                        }
                      },
                      {
                        "elmType": "div",
                        "txtContent": "[$ProjectManager.Title]",
                        "style": {
                          "display": "block"
                        },
                        "attributes": {
                          "class": "ms-fontWeight-regular ms-fontColor-neutralPrimary"
                        }
                      }