Settings - What's the purpose of the "Explicit Column Selection" Setting?

Many users often discover this setting only when they encounter a problem where data doesn’t load or appear correctly. In such cases, disabling this setting can magically fix the problem.

What exactly is the purpose of this setting and how does it work?

In this post, we’ll explore how this setting works against a SQL Server data source.

What does "Explicit Column Selection" do?

When an app carries out a data retrieval operation, “Explicit column selection” improves performance by retrieving only the data in the rows and columns that are necessary. It is enabled by default and it is good practice to retain this setting, because it improves app performance.

This feature works only supported data sources, which includes SQL Server and Dataverse.

Demonstration - Data Retrieval with "Explicit Column Selection" Enabled

To demonstrate, we'll build an app based on a Property table. This table stores property details and contains many columns.


Our demonstration app contains a screen with a gallery control. This gallery contains two labels - one that displays the Address1 field, and the other that displays the City field.

Next, we run the app and trace the data retrieval using SQL Server profiler. From this result, we see that the app issues a query that selects only the PropertyID, Address1, and City fields. This outcome is efficient, because we retrieve only the necessary data.


Demonstration - Data Retrieval with "Explicit Column Selection" Disabled

We now turn off “Explicit column selection” and repeat this exercise. As we expect, Power Apps issues a query that returns all columns. This query is far less efficient because we return more columns than is necessary.



What Practical Impact does this have on Performance?

With this example data, the data transfer size of all columns in 2,000 rows is 456KB. With just the PropertyID, Address1, and City fields, this falls to 152KB. With this specific example therefore, “Explicit column selection” can reduce the gallery load time by around 60%.

What problems can “Explicit Column Selection” cause?

Most commonly, this setting can prevent data loading or appearing correctly in an app. If we experience some of these problems, we should investigate the “Explicit column selection” setting:

  • Certain fields appear blank, particularly in cases where we populate controls based on collections that are pre-populated from SQL Server
  • Drop-down fields fail to show the correct data
  • Controls populate correctly at design time, but not at runtime.

Example of a Typical Problem

Here’s an example of a typical problem. Here, we have a table of issues that are linked with the properties table through the PropertyID field.


Let’s say we want to populate a collection of issue records that match PropertyID 35. To do this, we write the following formula:

ClearCollect(colIssues, Filter('[dbo].[Issue]', PropertyID=35))

When we run this and inspect the colIssue collection, we see that the formula returns only data for the IssueID and PropertyID fields. The values in all other fields are blank. 


In practical terms, this means that we cannot use this collection to display the issue descriptions, because these values have not been loaded into the collection.

Fixing this Problem

The fix for this problem is to explicitly define the columns that we want to return when we build the collection. We can do this by calling the ShowColumns function.

ClearCollect(colIssues, 
ShowColumns(Filter('[dbo].[Issue]', PropertyID=35), "IssueID", "Description")
)

As we can see, the collection will now include just the IssueID and Description fields.
 

Conclusion

In summary, "Explicit Column Selection" is a setting that improves performance with SQL Server and Dataverse data sources. The best practice is to keep this setting enabled.
This setting can cause unexpected behaviour with data not appearing as expected. Often, the easiest fix is to turn off “Explicit column selection” however, the best way to solve these types of issue is to explicitly define the columns that we want to return with the ShowColumns function.

Related posts

Data - How to remove trailing comma all rows in a table
February 20, 2025
Data - How to find the common rows from 3 or more collections
October 06, 2024
Data - How to show the distinct rows from 2 data sources or collections
February 26, 2024
Data - How to implement circular rotational date sorting
February 21, 2024
Bug - What to do when the data section of the Power Apps Maker portal doesn't work
June 18, 2023
Data - Combine columns from separate tables into a single table
October 13, 2022
Formula - Transposing/converting rows to columns- an almost impossible task?
September 23, 2021
Data - How to rename field names in a record
July 14, 2021
Data - How to hide duplicate rows in a gallery / show distinct multiple columns in a gallery
July 09, 2021
Data - Retrieving news/forum/blog articles with RSS
June 26, 2021
Data - How to sort by partial numbers in a text field
June 23, 2021
Data - How to return the last record from a table
June 19, 2021
Data - How to create bulk test/dummy records with random values
June 18, 2021
Data - 3 things you should know before using the MySQL or PostgreSQL connectors
May 11, 2021
Data - A walkthrough of how to migrate the data source of an app from Excel to Sharepoint
April 26, 2021
Data - How to enforce unique values (or prevent duplicate values) in one or more columns
April 19, 2021
Data - How much mobile data does Power Apps consume? What ways can we minimise this?
March 28, 2021
Data - How to save and retrieve Google calendar entries
March 14, 2021
Data - How to save and retrieve Google contacts
March 10, 2021
SQL - Caution! This is how users can hack shared SQL connections
January 23, 2021
SharePoint – 2 Mistakes to avoid when importing Excel data
January 10, 2021
SQL - Don't let this DateTime bug catch you out!
January 05, 2021
SQL Server for Beginners Part 3 - Installing On-Premises Gateway
January 24, 2019
SQL Server for Beginners Part 2 - Installing Management Studio
January 14, 2019
SQL Server for Beginners Part 1 - Installing SQL Server
January 04, 2019
Searching data–What you need to know about case sensitivity
December 27, 2018
Images - How to create images that can change depending on data
November 09, 2018
Excel - Reasons NOT to use Excel as a data source
September 25, 2018
SharePoint - What you need to know about Filtering Data
September 16, 2018
Formulas - Generating Row Numbers
April 05, 2018