Fix the SharePoint Gantt Chart “Failed to Compare Two Elements” Error
Question details
Resolve an error when opening a SharePoint Online task list in a Gantt view after changes to the Task Name column.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- A user wants to view tasks in a Scheduling Gantt view and use a drop-down for task-related values.
- Observed behavior
- The Gantt view displays “Failed to compare two elements in the array,” particularly after the Task Name column was renamed.
Open the affected task list and review its columns and Gantt view settings. Note which Task Name field is required and whether the Scheduling Gantt view has custom settings.
Create a task list with the original Task Name column intact
Use this approach when the Gantt error began after the required Task Name field was changed or replaced.
On the SharePoint site, select Settings > Add an app, then create a Tasks list if the Tasks app is available.
Open the new list's List Settings and leave the original Task Name column unchanged and required. Do not remove it or replace it with a Choice column.
In List Settings, select Create column, choose Choice, and enter the values you want in the drop-down.
Add tasks with values in the required Task Name field and select values in the new Choice field. Switch to the Gantt view and check that it opens.

Review the customized Gantt view and column changes
Use this check if the error persists or if changes other than the Task Name column may be involved.
Track task data in WPS Spreadsheets
WPS Office is a free, lightweight alternative for working with task data in a familiar spreadsheet interface. Its Microsoft Office format support makes it easy to move existing files, although it does not repair SharePoint Gantt views.

Frequently Asked Questions
Can I replace the Task Name column with a drop-down?
Keep the original Task Name column required and unchanged. In List Settings, use Create column to add a separate Choice column for drop-down values.
Will renaming the task list cause this error?
Renaming the list itself is different from changing the Task Name column. If the error continues, review the list's columns and the affected Gantt view settings in List Settings.
What if only my customized Gantt view shows the error?
Open the customized view under List Settings > Views and review its columns and scheduling settings. Compare it with the standard Gantt Chart view, if available.
Does WPS Office fix the SharePoint Gantt view?
No. The SharePoint view and task list settings must be corrected in SharePoint. WPS Spreadsheets can be used separately to organize task data in Excel-compatible files.




