question

agrace91-8574 avatar image
0 Votes"
agrace91-8574 asked AllenXu-MSFT answered

Expanding list items

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


office-sharepoint-onlineoffice-sharepoint-server-development
screenshot.png (105.8 KiB)
screenshot.png (105.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered

Hi @agrace91-8574 ,

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.


image.png (49.7 KiB)
image.png (29.8 KiB)
image.png (27.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.