web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collecting SQL data wi...
Power Apps
Answered

Collecting SQL data with a filter

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello PowerApps commmunity,

I am fairly new to PowerApps and am having difficulties understanding where I go wrong in my logic here.

Case:

I have a table of ~100 rows and I would like to collect some of these rows and place them in a collection OnStart.

 

In SQL terms what I am trying to achieve is as simple as:

 

 

SELECT *
FROM DB.Table
WHERE [ID] LIKE 'Default%'

 

 

 

But I am having an embarrassing amount of difficulties in achieving this.

I tried this simple code:

 

 

ClearCollect(col_DataDefaults,
 Filter('DB.TableName', "Default" in ID) 
);

 

 


This return only the rows I need - so far so good.
I also get all of the columns in the table - great.
BUT, all columns except for the ID columns that I am filtering on contains blank values.

From what I understand about delegation, using something like AddColumns() is not sustainable because of delegation, is this correct?

I need to pull these specific rows to use as default values in various locations in my app.

Thank you in advance for any help

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried to step the query like this:

     

    ClearCollect(col_DataDefaults, 'PowerAppDev.Konfig_tags');
    
    
    Filter(col_DataDefaults, "Default" in ID)

     

    But I still end up with the same result where I the correct data in the ID column but the rest of the columns remain blank.

    I must be missing something simple and obvious here.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    You could do the filtering in Sql and create a view to use in PowerApps.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello Drrickryp,

    Thank you for your message.

    Writing a query that can be delegated would also result in data being filtered in SQL.

    I realize I can create views but am afraid of the amount of views I will end up with ultimately.

    There must be a way to pass this simple query along to the DB? I can do it without any issues in PBI or Automate. It's a super simple filter it makes no sense if I cannot delegate this to backend. 😞

  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    @Anonymous 

    'Explicit column selection' is the reason why the columns other than ID contain blank values. This is a performance optimisation by Power Apps, which is a good thing. You can retrieve the other columns that you require by calling ShowColumns:

    ClearCollect(col_DataDefaults,
     ShowColumns(Filter('DB.TableName', "Default" in ID),
     "ID",
     "ColumnYouWant1",
     "ColumnYouWant2",
     "ColumnYouWant3" )
    );
    
    
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you @timl for both the example and taking the time to explain this to me.
    It is now working and the behaviour is both logical and preferred now that I understand it.

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    You're welcome @Anonymous 

    Just in case it might be of help to you, the Power Apps StartsWith function enables you to do the equivilent of LIKE 'Default%' in SQL.

    The in operator that you're currently using will be doing a LIKE '%Default%' 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard