How to Display a SharePoint List View as a Gantt Chart Timeline Using View Formatting

7–10 minutes

In my recent YouTube video about Microsoft Lists vs Excel, a viewer commented and asked if Microsoft Lists can display a timeline bar, similar to a Gantt chart, in a list. The answer is yes! With some view formatting using JSON, it’s possible. If you’re not familiar with JSON, don’t worry—I’ll walk you through the entire process, start-to-finish, in this post or my video tutorial.

How to create a Gantt chart view of a list

To create a Gantt chart/timeline view, you must first prepare your list to match the JSON (or modify the JSON to match your list). I’ll walk you through list set up as well as implementation. First, let’s prepare your list. You can follow the blog post or watch the video demonstration.

Step one: Set up your list columns and sort your list view

Your list must have each of the following columns configured as follows. Create each one, being careful to name it exactly as shown (no spaces).

TypeInternal NameRequiredValues
Single line of textTitleYes
DateProjectStartYes
DateProjectDueYes
DateTaskStartYes
DateTaskDueYes
Number (format as percentage)ProgressYes
ChoiceTaskTypeNoTask, Milestone
People (single select)AssignedToUserYes
Multiple lines of text (no format)TaskDescriptionYes
Table from List-Formatting/view-samples/project-gantt-chart at master · pnp/List-Formatting · GitHub

Tip
Already have a list with pre-existing columns you want to use? You can modify the JSON script to find and replace the example’s column names with your own. It’s important to use the internal field name. You can find this by going to List Settings, selecting the column name, and checking the browser’s URL for whatever comes after Field= at the end.

Next, sort your list view by TaskStart, ascending (older to newer). In my video demonstration, I take this one step further and do a multi-level sort (make TaskType, ascending the secondary sort) to make sure milestones with the same start date as tasks show up first with tasks following.

If your list is empty, you may wish to add some sample data to ensure the view formatting works as expected once applied. Next, let’s apply the JSON to our list view.

Step two: Apply the JSON to your view’s formatting

To apply JSON to a list view, follow these steps:

  1. Select the list view name’s dropdown arrow, then Format current view.
  2. Select Advanced mode.
  3. Replace everything in the JSON box with the provided JSON.
  4. Select Save.

Supporting multiple projects

If you need the Gantt view to allow users to switch between multiple projects, see my video demonstration where I add one more text (or choice) column for ProjectName. The Gantt view can then be grouped by ProjectName so that users can drill down and up through various projects, all sharing the same Gantt view tab rather than creating multiple views per project. Note that each unique project must have the same ProjectStart and ProjectDue dates in every task and milestone item related to that project.

View formatting JSON

Thanks to Geert de Kooter for sharing the PnP formatting example. If you’re unable to access the link, the code (as of 9/22/2024) is provided below. For more details or any updated versions, be sure to check the official page on GitHub.


Discover more from Nate Chamberlain

Subscribe to get the latest posts sent to your email.

5 responses to “How to Display a SharePoint List View as a Gantt Chart Timeline Using View Formatting”

  1. Augusto Avatar
    Augusto

    Hi Nate,

    I followed your instructions and was able to do everything, including the grouping at the end. However, the progress bar shows 0 progress regardless of the value in the Progress field. I have entered values ranging from .01 to 500 and the progress bar still shows zero. Additionally, selecting 0%, 25%, 50%, 75%, or 100% does not update the progress field or reflect in the progress bar.

  2. Pierre Sieber Avatar
    Pierre Sieber

    Can this copy&past to a new one (Projekt) or must create it in a new projekt again?

  3. Paul Avatar
    Paul

    This is great. Thank you Nate.
    On the chart, my percentages are mostly covered by the bars. For most, all you can see is the %, for others, the last digit and the % sign.

    Can you help me fix this please?

  4. swag5b3589aad72 Avatar
    swag5b3589aad72

    Nate, this is Great! Thank you for sharing!

  5. Markus Benigni Avatar
    Markus Benigni

    Dear Nate, that’s awesome!

    How could I make sure that users only have access to tasks and place comments on tasks which are assigned to them?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nate Chamberlain

Subscribe now to keep reading and get access to the full archive.

Continue reading