Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Display all values from a SharePoint multiple choice column in a combobox

Posted on by 2

dI have a choice column in SharePoint which allows multiple values from a separate lookup. When linking this to a PowerApp, is there a way to store all the values into a collection, so that when I create a Combobox dropdown, it only displays the items that are present in the list.

For example, the below selections are from a list of all UK cities

ID Name
1 London, Birmingham
2 Manchester
3 Manchester, Leeds, Blackpool
4 London, Leeds
5 Birmingham

Can I have a dropdown in PowerApps that only includes the distinct values from the 5 records above?

ClearCollect(colCities,IncidentLog.Cities)

Collect( colCities, ForAll(IncidentLog, { CityNames: Cities } ) )

Do I need to loop through all the records? I've tried

Clear(colCities);ForAll(IncidentLog.Cities, Collect(colCities, [ThisRecord.Cities.Value]))

I've tried using the following formula:

Distinct(IncidentLog,Cities .Value) 

But it combines the values for each record

 

Categories:
  • Suggested answer
    madlad Profile Picture
    madlad 2,637 on at
    Display all values from a SharePoint multiple choice column in a combobox
    Hi!
     
    I believe here you could use the ungroup function to separate these into individual cities.
    Something along the lines of:
    ClearCollect(
      colCities,
      Distinct(
        Ungroup(
          IncidentLog,
          Cities
        ),
        Value
      )
    )  
     
    ^This separates the city names, then gets the distinct ones
     
    Hope this helps! :)

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard