Lookup Column - Additional Fields formatting and nth reference
When you format a
column or view and loop a lookup column
But you wish to reference "additional fields of that lookup either via nth reference of the loop ex:
I have 2 lists Products & Colors
Products has field assignedcolors , which references Title of Colors but addional fields are "colorcode", "RGB Value"
So when looping
{
"elmType": "div",
"style": {
"display": "flex",
"height": "150px",
"width": "100%"
},
"children": [{
"forEach": "color in [$product_colors]",
"style": {
"flex-grow": "2",
"padding": "5px",
"background-color":"[$color_rgb][loopIndex(color)]"
},
"elmType": "div",
"txtContent": {
"operator": "+",
"operands": [
"[$color.lookupValue]",
"\n",
"[$color_code][loopIndex(color)]"
]
}
}]
}

1 comment
-
Kevin Noseworthy commented
{
"elmType": "div",
"style": {
"display": "flex",
"height": "150px",
"width": "100%"
},
"children": [{
"forEach": "color in [$style_colors]",
"style": {
"flex-grow": "2",
"padding": "5px",
"background-color": "[$color_rgb][loopIndex(color)]"
},
"elmType": "div",
"txtContent": {
"operator": "+",
"operands": [
"[$color.lookupValue]",
"\n",
"[$color_code][loopIndex(color)]"
]
}
}]
}