cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
plwms
Frequent Visitor

Limited Drop Down List

Hey!

 

I'm having an issue with a drop down list on my app.

I have one simple radio control with 3 options (OPT1, OPT2 and OPT3) that filter the column AREA fro my database. When I select one of them, it filters the name's column with the names that correspond to the AREA selected in the radio button.

 

This is the formula that I'm using in items in my drop down:

SortByColumns(Distinct(Filter(MY_DATABASE;Radio_area.Selected.Value=AREA);NAMES);"Result";If(SortDescending1; Descending; Ascending))

 

My database is a SharePoint list with 4.500 itens. The issue is that when selected, OPT1 should populate the drop down with 68 names but it's only getting 65 of them.

 

The OPT2 return the 49 values and OPT3, 30 values (all correct).

If I try to change the missing names from OPT1 to OPT2, they appear correctly.

 

So, is there any limitation in drop down lists with large numbers?

2 ACCEPTED SOLUTIONS

Accepted Solutions
KrishnaV
Community Champion
Community Champion

Hi @plwms,

 

I have experienced this issue and I was able to resolve this. Based on my experience here are 2 possible solutions:

  1.  Enhance your Filter by adding and or conditions to cutdown the number of results as part of the resultset, because as @Drrickryp said Disnticnt() in Power App is not a delectable function. (I know this might not be possible unless we revisit the business requirement one more time or add one more checkbox / radio control on the screen)
  2. Move all the values you want to show as part of the dropdown to the master list (another SP list) and make that as a choice field in the Sharepoint list. Then refer that as part of your dropdown control.

I have seen this issue mostly encounter while we implement cascading dropdown lists.

 

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

 

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 



I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a THUMS-UP and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

plwms
Frequent Visitor

Using @KrishnaV's idea, I found a solution!

I created a new SP list with two colums: a list of names that I wanted to show in my drop down (with the same names that I have in my first SP list) and the OPT from radio button associated to that name. The first colums is called NAME and the second AREA_NAME, respectively.

 

Then, I used that entry in Items:

ForAll(Filter(DATABASE_2_WITH_2COLUMNS; AREA_NAME = Radio_area.Selected.Value); NAME)

  

This is working for me 🙂

View solution in original post

6 REPLIES 6
Drrickryp
Super User
Super User

Hi @plwms 

Distinct is not a delegatable function so it will only apply to the first 2k items in your list.  One way to deal with it is to create two collections, one sorted ascending and the other sorted descending.  You can then combine them.

 

 

Collect(colAsc,Sort(yourlist,ID,Ascending)); 
Collect(colDesc, Sort(yourlist, ID, Descending));
Collect(colFinal,colAsc,colDesc)

 

 

then use colFinal in your formula for the Items property of the dropdown instead of MY_DATABASE and look at how that compares with what you were doing before. Since your list is 4500, there are still 500 items that won't be included in your combined collection.  Is it possible to get your original list down from 4500 to 4000 by prefiltering it according to your Radio selections, collecting each result and then combining the collections and then using Distinct() on the final combined collection.

The issue is that in SharePoint, Filter() is delegatable and so there is no limit on the number of items obtained by a filter.  However, Collect(), ClearCollect() and Distinct() are not delegatable and so these functions are limited to no more than 2000 items but once collected, virtually all PowerApps functions are available to use as there are no delegation limits applied when the data source is a collection. 

KrishnaV
Community Champion
Community Champion

Hi @plwms,

 

I have experienced this issue and I was able to resolve this. Based on my experience here are 2 possible solutions:

  1.  Enhance your Filter by adding and or conditions to cutdown the number of results as part of the resultset, because as @Drrickryp said Disnticnt() in Power App is not a delectable function. (I know this might not be possible unless we revisit the business requirement one more time or add one more checkbox / radio control on the screen)
  2. Move all the values you want to show as part of the dropdown to the master list (another SP list) and make that as a choice field in the Sharepoint list. Then refer that as part of your dropdown control.

I have seen this issue mostly encounter while we implement cascading dropdown lists.

 

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

 

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 



I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a THUMS-UP and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

@Drrickryp @KrishnaV Thank you for your answer.

Hi, @KrishnaV!

 

I think I understood but i've never worked that way with these options... Do you have any example?

Hey, @Drrickryp!

 

Thanks for your answer. Actually, I can't reduce my SP list... Maybe the solution would be make a "loop" with collections until it reaches the end of SP list to collect all of the entries?

plwms
Frequent Visitor

Using @KrishnaV's idea, I found a solution!

I created a new SP list with two colums: a list of names that I wanted to show in my drop down (with the same names that I have in my first SP list) and the OPT from radio button associated to that name. The first colums is called NAME and the second AREA_NAME, respectively.

 

Then, I used that entry in Items:

ForAll(Filter(DATABASE_2_WITH_2COLUMNS; AREA_NAME = Radio_area.Selected.Value); NAME)

  

This is working for me 🙂

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,277)