Forum Discussion
View Formatting - Can't display People Field
- May 03, 2020
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" } }
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"
}
}
Thanks a lot. If I use only one field it works for me. I will digg in my code to find the error when displaying multiple Fields