cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
patricia_r
Helper II
Helper II

Formula for some reason not working as expected.

Hello,

 

I need your assistance on determining if the formula that i am using is wrong or i need to add to it. I have a dropdown where i select list of communities that i am getting from my datasource which is SharePoint yet i am seeing duplicates and i don't understand why. Here is the formula i am using:  Sort(Distinct(FormInput, CommunityName), Result). Any ideas on why this would be happening?

 

Thank you

6 REPLIES 6
CNT
Super User
Super User

@patricia_r Are all these Community Names spelt correctly without any extra spaces? Could you share u'r SP List and also your gallery.

zmansuri
Super User
Super User

a42.jpg

Your formula looks fine. I did testing on my side. Its working

@CNT Yes they are spelled correctly. Also i am noticing that all of them are not showing up either. I know that Distinct is not a delegable query. I have over 80 different communities. 

@patricia_r How many records do you have in the SP List in total?

@CNT they are over 2K 

Anonymous
Not applicable

PowerApps can manage only 2000 items max

If your SP is over 2k yo will need to create Collections in PowerApps to collect the data and the create the master collection to join all the values 

In the On Start option or On Visble (of your first sceen)
insert this

ClearCollect(
Collection_1,
Filter(
SP_List,
ID < 2000
)
);
ClearCollect(
Collection_2,
Filter(
SP_List,
ID > 2000 && ID < 4000
)
);
ClearCollect(
Master,
Collection_1,
Collection_2
)  //Your will need to use a differente ID column the ID from SP wont work for this formula



Then in your dropdown use your formula

Sort(Distinct(Master, CommunityName), Result)



 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,118)