cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
manjotsingh057
Helper IV
Helper IV

DISTINCT Function in PowerApps

I have a on premise SQL table where we have 16000 records.

 

There is a column Named "ApplicationType".

We want to populate a dropdown in PowerApps with unique Application Type values that are there in that table.

 

So i used below query to fetch distinct Application Type values.

Distinct('[dbo].[SpecialProjects]',ApplicationType);

 

Issue : 

Since PowerApp fetches 200 records at one time so this formula retrieves distinct values only for those 200 records.

This way i get only 1 unique ApplicationType values out of 3.

 

Any way by which we can get all distinct values of a column from SQL table?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @manjotsingh057

Yes, it's possible to build cascading drop downs with SQL Views.

My post towards the end of this thread includes some sample formula.

https://powerusers.microsoft.com/t5/General-Discussion/Slice-Large-SQL-Table-By-Multiple-Parameters/...

View solution in original post

4 REPLIES 4
timl
Super User
Super User

Hi @manjotsingh057

The way to do this is to create a SQL Server View that returns your distinct values.

https://powerusers.microsoft.com/t5/General-Discussion/Retrieve-distinct-values-over-a-column-from-S...

Post back here if you need more specific details on how to do this.

@timl

Thanks for that post.

But if i want to create a cascaded drop downs, Will that be possible based on this logic ? Since i will not be knowing what all values would be there in next set of results that would be Loaded by PowerApps ?

 

Scenerio:

  1.  Page has multiple drop down fields which filter the results.
  2. You select value from drop down 1 and based on the results received drop down 2 values should be filtered as well.
  3. Once you select drop down 2 values then again following same logic.

 

Thanks in Advance !!

 

 

Hi @manjotsingh057

Yes, it's possible to build cascading drop downs with SQL Views.

My post towards the end of this thread includes some sample formula.

https://powerusers.microsoft.com/t5/General-Discussion/Slice-Large-SQL-Table-By-Multiple-Parameters/...

View solution in original post

Thanks a lot @timl

That works.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,009)