List Web Part Expand/Collapse View Broken on Modern Site Page

Copper Contributor

When attempting to display a list view on a SharePoint Online Modern Site Page for FAQ questions and answers the Answer field (multiple lines of text) is not displaying the values. In the examples below all question and answer fields have values and should display. In the actual list itself the same view shows both the Answer and Question values just as expected.

list-required.png

Answer Field = Required (List Web Part)

When I have the Answer field set as required (no matter if it is Plain, Rich, or Enhanced Rich text) it shows that required info is missing even though all the Answer fields have values in them. Using the List View Web Part I see the following:

listWP-required1.png

If I click the heading, "Question: Question #1 here? (1)" in the list view web part I then see the value for the Answer:

listWP-required2.png

Answer Field = Not Required (List Web Part)

When I have the Answer field set as not required (no matter if it is Plain, Rich, or Enhanced Rich text) it shows no value even though all the Answer fields have values in them. Using the List View Web Part I see the following:

listWP-notRequired1.png

If I click the heading, "Question: Question #1 here? (1)" in the list view web part I then see the value for the Answer:

listWP-notRequired2.png

5 Replies

@iDrive  Did you manage to find fix for this? I am having same issue.

@iDrive Has a solution been found for this?  I'm having the same problem.

@tgjerdahl and @hazza365, I just tested this out again and it is now working on a test page. With that said, it wasn't working when we needed it and the solution I came up with was a custom formatted list view based off the PnP Bulletin Board list view here

Example of my custom list view:

FAQ.PNG

My custom list view JSON:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "hideListHeader": true,
  "hideSelection": true,
  "rowFormatter": {
    "elmType": "button",
    "customRowAction": {
      "action": "defaultClick"
    },
    "attributes": {
      "class": "ms-bgColor-white ms-bgColor-themeLight--hover"
    },
    "style": {
      "width": "100%",
      "margin": "5px 0",
      "padding": 0,
      "border": "none",
      "cursor": "pointer"
    },
    "children": [
      {
        "elmType": "div",
        "attributes": {
          "class": "ms-borderColor-themePrimary ms-bgColor-themePrimary"
        },
        "style": {
          "min-width": "auto",
          "display": "flex",
          "border-width": "3px",
          "border-style": "solid",
          "box-sizing": "border-box",
          "align-items": "center"
        },
        "children": [
          {
            "elmType": "div",
            "attributes": {
              "iconName": "Unknown",
              "class": "ms-fontSize-su ms-fontWeight-regular  ms-fontColor-white",
              "title": "Question"
            },
            "style": {
              "flex": "none",
              "padding": "6px",
              "padding-left": "10px",
              "height": "42px"
            }
          }
        ]
      },
      {
        "elmType": "div",
        "attributes": {
          "class": "ms-fontColor-themePrimary ms-borderColor-themePrimary ms-fontWeight-semibold ms-fontSize-l"
        },
        "style": {
          "border-width": "3px",
          "border-style": "solid",
          "box-sizing": "border-box",
          "width": "100%",
          "text-align": "left",
          "padding": "15px 5px",
          "overflow": "hidden"
        },
        "children": [
          {
            "elmType": "div",
            "txtContent": "[$Title]",
            "style": {
              "height": "24px"
            },
            "attributes": {
              "title": "Click to view answer"
            }
          }
        ]
      }
    ]
  }
}

 

@iDrive  Thanks mate, that helps...