Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Concat and Distinct from all Comboboxes in a gallery

(1) ShareShare
ReportReport
Posted on by

I have a text box that I am trying to get all combo boxes selected values from a gallery to be in. I can get the Concat function to work but I am having issues on how to incorporate the Distinct to remove the duplicates unless there is another way. How can I remove duplicates using Distinct or another function?

 

The code I have to Concat is: 

Concat('gal New Tasks'.AllItems,'Tasked Orgs',"; ")
 
  • kingy61422 Profile Picture
    on at
    Re: Concat and Distinct from all Comboboxes in a gallery

    Thank you for the help and it works

  • Verified answer
    madlad Profile Picture
    2,637 Super User 2025 Season 1 on at
    Re: Concat and Distinct from all Comboboxes in a gallery

    @kingy61422 

     

    It gets progressively more complicated, but this is the method I use:

     

    Concat(
     Distinct(
     Ungroup(
     ForAll(
     *YourGallery*.AllItems, 
     *YourComboBox*.SelectedItems
     ), 
     Value
     ), 
     *Field*
     ), 
     Value, 
     ", "
    )

     

    Not sure if there's a more efficient way though.

     

    Hope this helps! 🙂

  • kingy61422 Profile Picture
    on at
    Re: Concat and Distinct from all Comboboxes in a gallery

    I am and that works for it being a single select combo box. What changes would I need to make for a mulitselect combo box? Might need to know for the future.

  • madlad Profile Picture
    2,637 Super User 2025 Season 1 on at
    Re: Concat and Distinct from all Comboboxes in a gallery

    @kingy61422 

     

    To confirm, are you trying to concatenate the values from the combobox within the gallery?

     

    If so, try something like:

     

    Concat(Distinct(*YourGallery*.AllItems, *YourComboBox*.Selected.*Field*), Value, ", ")

     

     ^Just throw in your gallery, combobox, and desired field names here. 

     

    If it's a multiselect combobox, you'll need to make a couple other changes as well.

     

    Let me know! 🙂

  • kingy61422 Profile Picture
    on at
    Re: Concat and Distinct from all Comboboxes in a gallery

    I have tried 

    Concat(Distinct('gal New Tasks'.AllItems,'Tasked Orgs'), Result, "; ") but I get an error saying 'Result' isn't recognized and I have tried 
    Concat(Distinct('gal New Tasks'.AllItems,'Tasked Orgs'), Value, "; ").
    My gallery items are a collection but the combo box items are from a choice field. When I start the collection I use ClearCollect(colNewTask,{'Tasked Orgs':""})
  • mmbr1606 Profile Picture
    12,104 Super User 2025 Season 1 on at
    Re: Concat and Distinct from all Comboboxes in a gallery

    hey @kingy61422 

     

    have u already tried:

     

     

     

    Concat(Distinct('gal New Tasks'.AllItems, 'Tasked Orgs'), Result, "; ")
    

     

     

     

    The Distinct function returns a table with a single column named Result that contains the unique values.

    You might need to adapt to your needs.

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,609 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard