Fix Error Occurred While Querying a Data Source in SharePoint
Question details
A user is experiencing a data source querying error in SharePoint after publishing customized views via InfoPath.

- 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.
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.
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.
Navigate to your SharePoint site, open the affected list, click the Gear icon in the upper right, and select 'List settings'.
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.
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.

Migrate from InfoPath to Power Apps
InfoPath is deprecated in modern SharePoint environments. Migrating your custom forms to Power Apps resolves querying issues and improves scalability.
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. Download and Install: Visit the official WPS Office website to download the free installation package for your operating system.
- 2. Open Your Files: Launch WPS Office and directly open your existing Microsoft Office documents without worrying about formatting loss.
- 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.

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.




