How to format columns in SharePoint Task List Using JSON?

ACAD-Nhu.Le Quynh 0 Reputation points
2023-11-22T09:35:38.0633333+00:00

Hi,

I'm trying to format columns in a SharePoint Task List using JSON, similar to how I can format columns in a regular SharePoint list. However, when I apply my JSON formatting to columns in the Task List, I'm unable to preview the changes or see them applied after saving, unlike when formatting columns in a standard SharePoint list.

Is it possible to format columns in a SharePoint Task List using JSON in the same way as a SharePoint list? If so, am I missing a step to properly apply and view the formatting changes? Any advice on the correct way to format Task List columns would be appreciated.

Thanks!

Microsoft 365 and Office SharePoint Development
{count} votes

1 answer

Sort by: Most helpful
  1. Ling Zhou_MSFT 23,620 Reputation points Microsoft External Staff
    2023-11-23T05:12:55.52+00:00

    Hi @ACAD-Nhu.Le Quynh,

    Thank you for posting in this community.

    Unlike other standard SharePoint lists, task lists are only available in classic experience, and JSON formatting of columns is not supported in classic experience.

    User's image

    Reference: SharePoint Online: List Conditional Formatting in Classic Experience

    You can use a JavaScript or CSR if you still want to format the columns of the list.

    **1.**JavaScript:

    • Enable Script Web Part in SharePoint Online. Download the latest SharePoint Online Management Shell, install and run it, then run the following commands to connect to SharePoint: $orgName="<name of your Office 365 organization, example: contosotoycompany>" $userCredential = Get-Credential -UserName $adminUPN -Message "Type the password." Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0
    • Edit Page: User's image
    • Add Script Web Part: User's image
    • Enter your JavaScript.

    2.Using Client Side Rendering:

    You can refer this article to learn about Client Side Rendering.

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link. 

    If you want to use it in SharePoint Online, you need to add custom client-side rendering to a SharePoint-hosted SharePoint Add-in first.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


Your answer

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