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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Choices, distinct, and...
Power Apps
Answered

Choices, distinct, and SharePoint list

(0) ShareShare
ReportReport
Posted on by 583

I have a SP list and am using a custom PowerApps form. The column is a Choice column and when I leave items as Choices([@'Controlled Locations'].Department) it updates the list fine but when I add Distinct like this Distinct(Choices([@'Controlled Locations'].Department),Value) to remove the duplicates it no longer updates the list. All other properties are left to the default. Any ideas why or how I can make this work?

 

Thanks

Categories:
I have the same question (0)
  • Waegemma Profile Picture
    583 Super User 2024 Season 1 on at

    Hi @StephenGW ,

     

    I tried it too on a choice column:  no error message, choices are selectable but the list doesn't update.

    I do wonder why you have a non-unique choices column: if it's somehow automatically filled, perhaps there's a way to filter distinct values at that time, instead of in the dropdown?

     

    Succes,

     

    Marc

     

  • StephenGW Profile Picture
    583 on at

    Sorry, I misspoke it is a LookUp column looking at a SP list of locations. So the first column is similar to a city with the second column being like a building and finally the last column is the building directory. So the first column would have many repeats of say New York and then several buildings in the second column which would also then repeat some too like building 1, building 2, ect. Then the third column would be like room12, room 13, ect. I'm not sure I can filter these this way.

     

    Anybody have any ideas why it won't work when I try to remove the duplicates?

  • Thomasjruss Profile Picture
    46 on at

    Hi Stephen,

     

    I've had an almost identical situation. I believe the issue is due to the distinct function giving an output of distinct text values. The filter function will do the same thing. The problem there is that the SP list wants a record. Unfortunately, I haven't found a solution. See the thread I made here.

     

     

  • Verified answer
    Thomasjruss Profile Picture
    46 on at

    Hey @StephenGW, despite my first post probably sharing more wisdom, I did find a solution to this elsewhere and wanted to share with you. 

     

    In the Items property, keep Distinct(Choices([@'Controlled Locations'].Department),Value) as you have it.

    In the Update property, write:

     

    {
    Value: yourlookupdatacard.Selected.Result,
    Id:
    LookUp(
    'yourreferencelist',
    thenameofthereferencecolumnwiththevaluethatmatchesyourselecteditem = yourlookupdatacard.Selected.Result
    ).ID
    }

     

    This way, it will update with a record even though the result of the distinct function is a value.

  • StephenGW Profile Picture
    583 on at

    That did it! Thank you for this solution!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard