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 / Concat and Distinct fr...
Power Apps
Unanswered

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',"; ")
 
Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    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

  • kingy61422 Profile Picture
    on at

    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':""})
  • madlad Profile Picture
    2,637 Moderator on at

    @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

    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.

  • Verified answer
    madlad Profile Picture
    2,637 Moderator on at

    @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

    Thank you for the help and it works

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard