SharePoint Document Issues

Fix Error Occurred While Querying a Data Source in SharePoint

Rana GarciaRana Garcia Nov 2, 2026 868 views

Question details

A user is experiencing a data source querying error in SharePoint after publishing customized views via InfoPath.

How to Fix Error Occurred While Querying a Data Source in SharePoint
Product
SharePoint / InfoPath
Device & OS
not provided
Scenario
Publishing InfoPath customized views to a SharePoint list.
Observed behavior
An 'Error occurred while querying a data source' message is displayed, typically tied to the SharePoint list view threshold.
Before you start

Ensure you have administrative or owner permissions for the SharePoint list and check the total number of items currently stored in the list before making threshold adjustments.

Solution 1Recommended

Manage the SharePoint List View Threshold

The error usually occurs because the list exceeds the Classic SharePoint view threshold of 5,000 items. You need to adjust the views to filter data properly using indexed columns.

Classic SharePoint has a hard limit known as the List View Threshold, set to 5,000 items by default. When an InfoPath form queries a list exceeding this limit without proper indexing or filtering, the server blocks the query to prevent performance degradation.

1
Access List Settings

Navigate to your SharePoint site, open the affected list, click the Gear icon in the upper right, and select 'List settings'.

2
Create Indexed Columns

Scroll down to the Columns section and click on 'Indexed columns'. Click 'Create a new index' and select the column you plan to use for filtering the view.

3
Modify the View Filters

Go back to List Settings, scroll to the 'Views' section, and click on the customized view that is failing. In the 'Filter' section, set the criteria using your newly indexed column so that the view returns fewer than 5,000 items.

Manage the SharePoint List View Threshold
Indexing Limits: Ensure you create indexed columns before the list actually surpasses the 5,000-item mark, otherwise SharePoint may restrict your ability to create new indexes directly.
Free Microsoft Office alternative

Boost Your Document Productivity with WPS Office

Dealing with complex SharePoint and InfoPath errors can disrupt your workflow. For your daily document, spreadsheet, and presentation needs, switch to WPS Office. It provides a lightweight, highly compatible, and user-friendly experience for all your essential office tasks without the heavy overhead.

  1. 1. Download and Install: Visit the official WPS Office website to download the free installation package for your operating system.
  2. 2. Open Your Files: Launch WPS Office and directly open your existing Microsoft Office documents without worrying about formatting loss.
  3. 3. Save to Cloud: Sign in to utilize the built-in WPS Cloud storage, ensuring your local files are safely backed up and accessible anywhere.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight installation with rapid startup times.Familiar, intuitive tabbed user interface ensuring a zero-learning-curve migration.Seamless cloud integration to save, edit, and manage documents easily.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the 5,000 item limit cause an InfoPath error?

SharePoint uses a List View Threshold to prevent database locks on the SQL server backend. If an InfoPath form requests data from a list over 5,000 items without appropriate indexed filters, the server stops the query to maintain overall farm performance, throwing an error instead.

Can I increase the List View Threshold in SharePoint Online?

No, the 5,000 item limit is a hardcoded architectural limit in SharePoint Online and cannot be changed by administrators. You must use indexed columns and filtered views to manage large lists effectively.

Is InfoPath still supported in Modern SharePoint?

InfoPath is considered a legacy tool and is not supported in Modern SharePoint experiences. Microsoft strongly encourages users to migrate custom forms to Power Apps for continued support and better performance.