Alternative to Discussion list in SharePoint Online

 



In SharePoint Online one of the most missed features from the legacy system is the ability to create discussion forums. Since we do not have the OOB functionality, but we still can achieve it using the OOB features. In this post, I will show you how you can create the discussion forums using OOB features and with a more attractive UI. 


Let's start and set up the discussion Forum.

STEP 1: Create necessary columns in Site Pages Library

To Achieve the functionality, I have made use of the "Site Pages" Library as it gives you the OOB ability to comment and like on the page. In order to make it fully usable, we will create a column 
  • PageType: This will tell us whether the page created is a discussion or the page
    • Values: Page, Discussion

STEP 2: Create Custom View

Create a View (in my case I have created the view by the name Discussion), and filter it based on the page type equals "Discussion"

STEP 3: Add Columns & View Formatting to the above-created view

Use the below code to add the necessary column into the view, so the metadata can be showing in the List view formatting.


Add-PnPView -List "Site Pages" -Title "Discussion Board" -Fields "Modified","_CommentCount","Description","ID","_LikeCount","BannerImageUrl","_AuthorByline","Title"


Formatting JSON can be taken from the below GitHub Link.



Step 4: Create the Template

  • Create a Blank Page
  • Edit the Page Properties
  • Set the PageType property to "Discussion"
  • Save the page as a template
Now whenever the new page is created, the user will get the option to create the page with the template and in that case, this property need not be set manually every time.

Step 5: Display the discussion list on any page

  • Create a blank page
  • Add the document library web part and select the "Site Pages" Library
  • Select the "Discussion" view created in Step 2
  • Hide the command bar (optional)

And Setup is completed. Now you have achieved the Discussion list alternative in SharePoint Online using the out-of-box features

Another benefit of this is that this is 
  • Highly scalable
  • Setup as many Discussion boards within the same site
  • Quick Setup can be scripted as well in order to replicate at multiple places
  • Out-of-box comments and likes count no need to have extra code
  • View count is still not accurate as MS uses 2 APIs to retrieve the information so there can be a mismatch in the count but is retrievable in future
  • Best Performance


Please let me know through your comments, how you liked the setup.

Thanks...

Sumit Kanchan 



Comments

Popular posts from this blog

Sorting in Typescript (Simple Arrays & Array of Objects)

SharePoint Framework (SPFx) Tab Control (react)

SPFx Chat Bot - using SharePoint Framework Extension