List formatting JSON not returning column values

Copper Contributor

 Hi all,

 

I have the following bit of JSON used to reformat a list view.  Everything seems to be working besides two fields - [$ProjectCategory] and [$ProjectorRun] - which don't seem to return any values, even though those fields are not actually empty (as verified on other views of the list).

 

I've checked that the internal column names match, and that the columns are included in the view.  The ProjectOrRun field is a choice field (similar to Status seen later on, which is working), and the ProjectCategory field is a lookup field.  Any other ideas on what could be wrong?

 

{

"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",

"debugMode": false,

"hideSelection": true,

"hideColumnHeader": true,

"rowFormatter": {

"elmType": "div",

"attributes": {

"class": "ms-borderColor-neutralLight"

},

"style": {

"flex-direction": "column",

"align-items": "stretch",

"box-sizing": "border-box",

"border-width": "1px",

"border-left-width": "4px",

"border-style": "solid",

"border-left-color": "=if([$Temperature] == 'Yellow', '#FFB900', if([$Temperature] == 'Red', '#e23800','#107C10'))",

"margin-bottom": "10px"

},

"children": [

{

"elmType": "div",

"style": {

"display": "flex",

"flex-wrap": "wrap",

"align-items": "center",

"box-sizing": "border-box",

"padding": "0 20px 10px"

},

"children": [

{

"elmType": "div",

"style": {

"flex": " 1 0 300px"

},

"children": [

{

"elmType": "div",

"style": {},

"children": [

{

"elmType": "div",

"attributes": {

"class": "ms-font-xl"

},

"style": {

"line-height": "1.5em",

"color": "#0077FF",

"margin": "8px 0"

},

"txtContent": "[$Title]"

},

{

"elmType": "div",

"attributes": {

"class": "ms-font-m"

},

"style": {

"line-height": "1.5em",

"margin": "8px 0"

},

"children": [

{

"elmType": "div",

"style": {

"display": "inline-block"

},

"children": [

{

"elmType": "span",

"style": {

"vertical-align": "bottom",

"margin": "0 9px 0 1px"

},

"attributes": {

"iconName": "FolderList"

}

},

{

"elmType": "span",

"attributes": {

"class": "ms-fontWeight-semibold"

},

"style": {

"margin-right": "18px"

},

"txtContent": "[$ProjectorRun]"

}

]

},

{

"elmType": "div",

"style": {

"display": "inline-block"

},

"children": [

{

"elmType": "span",

"style": {},

"txtContent": "[$ProjectCategory]"

}

]

}

]

},

{

"elmType": "div",

"style": {

"display": "inline-block"

},

"children": [

{

"elmType": "span",

"style": {},

"txtContent": "[$ExecutiveSummary]"

}

]

}

]

}

]

},

{

"elmType": "div",

"attributes": {

"class": "ms-borderColor-neutralLight"

},

"style": {

"flex": "0 0 200px",

"border-left-width": "1px",

"border-left-style": "solid",

"display": "flex",

"justify-content": "space-evenly",

"align-items": "center",

"margin": "8px 0"

},

"children": [

{

"elmType": "img",

"attributes": {

"src": "= @currentWeb + '/_layouts/15/userphoto.aspx?size=L&accountname=' + 'dummydata' + '&UA=0&size=HR48x48'",

"title": "= @currentWeb + '/_layouts/15/userphoto.aspx?size=L&accountname=' + 'dummydata' + '&UA=0&size=HR48x48'"

},

"style": {

"border": "1px solid #808080",

"border-radius": "50%",

"left": "50%",

"width": "48px",

"height": "48px",

"margin-left": "15px"

}

},

{

"elmType": "span",

"attributes": {

"class": "ms-font-m"

},

"style": {

"display": "inline-block",

"width": "90px",

"text-align": "left"

},

"txtContent": "Assignee Name"

}

]

}

]

},

{

"elmType": "div",

"attributes": {

"class": "ms-fontSize-sPlus ms-bgColor-neutralQuaternaryAlt"

},

"style": {

"padding": "4px 20px",

"line-height": "1.5em",

"display": "flex",

"justify-content": "space-between"

},

"children": [

{

"elmType": "div",

"children": [

{

"elmType": "span",

"attributes": {

"class": ""

},

"txtContent": "Targeted Completion: "

},

{

"elmType": "span",

"txtContent": "=[$TargetedCompletionDate]"

}

]

},

{

"elmType": "div",

"style": {

"margin": "0 10px"

},

"children": [

{

"elmType": "span",

"attributes": {

"class": ""

},

"txtContent": "Last Update "

},

{

"elmType": "span",

"style": {

"display": "inline-block"

},

"txtContent": "[$Modified]"

}

]

},

{

"elmType": "div",

"children": [

{

"elmType": "span",

"attributes": {

"class": ""

},

"txtContent": "Status: "

},

{

"elmType": "span",

"style": {

"display": "inline-block",

"text-transform": "capitalize"

},

"txtContent": "[$ProjectStatus]"

}

]

}

]

}

]

}

}

 

0 Replies