-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
area:list-formattingCategory: View, row & column formatting with JSONCategory: View, row & column formatting with JSONsharepoint-developer-supportsharepoint-developer-supportsharepoint-developer-supporttype:bug-confirmedConfirmed bug, not working as designed / expected.Confirmed bug, not working as designed / expected.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
- MS Edge Version 139.0.3405.86 (Offizielles Build) (64-Bit)
- SharePoint Online
Describe the bug / error
When forEach looping through a multi value field the iterator variable, in my case [$Governance], in customCardProperty is null.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"flex-wrap": "wrap",
"display": "flex"
},
"children": [
{
"forEach": "Governance in @currentField",
"elmType": "div",
"style": {
"box-sizing": "border-box",
"padding": "4px 8px 5px 8px",
"overflow": "hidden",
"text-overflow": "ellipsis",
"display": "flex",
"border-radius": "16px",
"height": "24px",
"align-items": "center",
"white-space": "nowrap",
"margin": "4px 4px 4px 4px"
},
"attributes": {
"class": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Governance]",
"Auswahl 1"
]
},
"sp-css-backgroundColor-BgLightGray sp-css-borderColor-LightGrayFont sp-css-color-LightGrayFont",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Governance]",
"Auswahl 2"
]
},
"sp-css-backgroundColor-BgLightGray sp-css-borderColor-LightGrayFont sp-css-color-LightGrayFont",
"sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderColor-neutralSecondary"
]
}
]
}
},
"children": [
{
"elmType": "span",
"style": {
"overflow": "hidden",
"text-overflow": "ellipsis",
"padding": "0 3px"
},
"txtContent": "[$Governance]",
"attributes": {
"class": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Governance]",
"Auswahl 1"
]
},
"sp-css-color-LightGrayFont",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"[$Governance]",
"Auswahl 2"
]
},
"sp-css-color-LightGrayFont",
""
]
}
]
}
},
"customCardProps": {
"formatter": {
"elmType": "span",
"txtContent": "[$Governance]"
},
"openOnEvent": "hover",
"directionalHint": "bottomCenter",
"isBeakVisible": true,
"beakStyle": {
"backgroundColor": "white"
}
}
}
]
}
]
}
Steps to reproduce
- Create SharePoint Online List
- Add Selection Field with multiple values allowed
- Select 2 values for the field
- Format column as in the example above
Expected behavior
Each customPropCard should the show the unique value of the selected values in the field.
Metadata
Metadata
Assignees
Labels
area:list-formattingCategory: View, row & column formatting with JSONCategory: View, row & column formatting with JSONsharepoint-developer-supportsharepoint-developer-supportsharepoint-developer-supporttype:bug-confirmedConfirmed bug, not working as designed / expected.Confirmed bug, not working as designed / expected.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.