Expanding list items

agrace91 21 Reputation points
2021-07-01T15:54:57.783+00:00

I am a total beginner so apologies for lack of technical knowledge!

I've used the custom list functionality to create a nice accordion-style FAQ (Frequently Asked Questions) in SharePoint.

However by nature some of the 'answers' are lengthy and overflow, needing the user to click 'expand' manually to read the full answer illustrated below.

110987-screenshot.png

Is there a way to display the full answer - I can imagine colleagues not finding the small 'expand' icon easy enough to find/use

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments
{count} votes

Answer accepted by question author
  1. Allen Xu_MSFT 13,891 Reputation points
    2021-07-02T07:41:10.797+00:00

    Hi @agrace91 ,

    From your screenshot, it seems that the "answers" column is a multiple lines of text column with enhanced rich text enabled, right? I tried using JSON formatting to customize a div of the column field container with below code.

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",  
      "style": {  
        "width": "500px",  
        "height": "500px"  
      },  
      "txtContent": "@currentField"  
    }  
    

    However, the contents inside the column fields are displayed as the source HTML code after applying the JSON code.
    111237-image.png
    As per my research, JSON formatting is not suppoted in multiple lines of text columns with enhanced rich text enabled. As an alternative, you can use a muliple lines of text column with enhanced rich text disabled and format it with the above JSON code.
    111293-image.png
    You can customize the parameter "width" or "height" of div in the code to meet your own requirement. And you can disable enhanced rich text by setting "Use enhanced rich text..." to No when editing column.
    111259-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.