Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Distinct Function not bringing correct result in dropdown data based on Sharepoint list

(0) ShareShare
ReportReport
Posted on by

I am using the below formula in the Items property of the dropdown 

 

Distinct(KomtraxImport,F3)

 

It has no error but the result is not correct.

The sharepoint list has 2356 records and should bring result of more than 12 rows

But it just bring the 1 row result only.

 

please guide

 

 

  • AmbrosePPCP Profile Picture
    5 on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Sometimes (Maybe almost every time) users are better than MS itself.

     
  • Verified answer
    BCBuizer Profile Picture
    22,034 Super User 2025 Season 1 on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Hi @MIA27 ,

     

    Given that StartsWith should return all values in case the StartText is blank, another solution may have to be looked at, for instance by adding a condition to look at the ID column:

     

    Filter(
    	KomtraxImport,
    	StartsWith(F3,DropDownModel.Selected.Value) || DropDownModel.Selected.ID = 0,
    	StartsWith(F6,DropDownCustomer.Selected.Value) || DropDownCustomer.Selected.ID = 0,
    	StartsWith(F5,FindSerialNo.Text)
    )
  • MIA27 Profile Picture
    on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Sir,

    I applied the code, was able to get the first row blank,  but my filter gallery brings no result, while it should bring all records as the criteria is Blank, 

    Which Means I need to change the filter code, below is the code I am using, please advise what changes to apply so that the blank can accepted to it.

     

    Filter(KomtraxImport,StartsWith(F3,DropDownModel.Selected.Value) && StartsWith(F6,DropDownCustomer.Selected.Value) && StartsWith(F5,FindSerialNo.Text))

     

    Kindly guide

  • BCBuizer Profile Picture
    22,034 Super User 2025 Season 1 on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Hi @MIA27 ,

     

    You can add a blank Item in the collection by replacing the Screen.Onvisible formula with the below:

     

    ClearCollect(colMyCollection, {ID:0});
    With( 
     {wLow: Sort(KomtraxImport, ID ), wHigh: Sort(KomtraxImport, ID, SortOrder.Descending ) },
     Collect( colMyCollection, wLow, Filter( wHigh, !(ID in wLow.ID) ) )
    );
    
  • MIA27 Profile Picture
    on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    sir,

    Just wanted to confirm as these dropdown is used to filter the gallery.

    By default it goes to the first records, 

    Is it possible to keep the first row Blank, so that at the opening time all the records will come up,

    If user wants he can select as required.

     

    Can I add like below :

     

    IsBlank();Distinct(colMyCollection, F3).Value

     

    To get the first row blank and then the data row

     

  • MIA27 Profile Picture
    on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Sir,

    Thank you so much, its done. Got the correct result after changing the limit.

    Not only solved, but also learnt so many thing during your guidance process.

     

    Thanking you again for your help and given time.

     

    very best regards.

  • Verified answer
    BCBuizer Profile Picture
    22,034 Super User 2025 Season 1 on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Hi @MIA27 ,

     

    What is your current Data Row Limit?

     

    You can find this by going to Settings, Settings and then scrolling down:

     

    BCBuizer_0-1679074393498.png

     

    If it is 500, please change it to 2000 and then try again.

  • MIA27 Profile Picture
    on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Sir,

    As advised, I added a label and added the formula as you guided.

    Found Result of collection is not same as of the total records of list.

    Collection shows only 1000 while the total records should be 2356

     

    below is the screen shot during play 

     

     

    MIA27_0-1679073916034.png

     

     

    Image of records at sharepoint list

     

    MIA27_1-1679073942187.png

     

     

    Please guide .

     

    Regards

     

     

  • Verified answer
    BCBuizer Profile Picture
    22,034 Super User 2025 Season 1 on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Hi @MIA27 ,

     

    Can you please insert a temporary label with the below as the formula for the Text property:

     

    CountRows(colMyCollection)

     

    The displayed number should match the number of items in your data source ('KomtraxImport') to verify if the collection has all the items.

  • MIA27 Profile Picture
    on at
    Re: Distinct Function not bringing correct result in dropdown data based on Sharepoint list

    Sir,

    I did the testing by Play before but it was not working.  Later after your last advise tried another by  I focused to another screen and then came back and play, found its working. But it showing only few records, it should bring 32 rows records , below is the screen shot during play. Also tried to move manually in dropdown by arrow but only these records in the row is showing. could not understand its working where is the balance row.

     

    MIA27_0-1679068638606.png

     

    Pls guide

     

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard