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/Concatenate a s...
Power Apps
Unanswered

Concat/Concatenate a single column of a data table with multiple columns

(0) ShareShare
ReportReport
Posted on by 84

Hello!

 

I have an app that has an Excel table as the backend data source.

 

Some of the fields are 'Customer Name', 'Location Name' and 'Device Name'. I have a Combo Box in PowerApps that has Customer Names, this, in turn, filters the Data Table in PowerApps to show the devices and locations only specific for that customer. 

 

The user can then select multiple 'Devices Names' in a separate Combo Box, this works fine, and I have a Concat function that splits out the Devices Names from the Combo Box. 


This leaves a column in the Data Table called 'Location Name', I want to be able to do the exact same Concat function I did on the Combo Box, so the locations will list (eg, Location A, Location B, Location C) this can be in any order. 

 

Any suggestions are greatly appreciated!

 

Thanks in Advanced

Andy!  

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    I tried this...maybe not the best way but it worked for me.

     

    Combobox On Change - ClearCollect(collection, ComboBox.SelectedItems.Device)

    Label Text - Concat(collection,Location,", ")

  • AndyH_JSY Profile Picture
    84 on at

    Thanks for your reply!

     

    What I am trying to do is Concat the fields within the Data Table, instead of the Combo Box. 

     

    Here is my Data Table (attached):

     

    What I am trying to do is Concat the 'Device Location field into a text box. So the text box would display 'Newcastle, Isle of Man' etc. 

     

    Ideally, I'd like to remove duplicates but this isn't required. 


    Thank you!

  • Community Power Platform Member Profile Picture
    on at

    How do you want to display the locations? In a label, etc.?

  • AndyH_JSY Profile Picture
    84 on at

    I've just edited my post as it wasn't displaying correctly. Hopefully, that is clearer!

  • Community Power Platform Member Profile Picture
    on at

    I think my first suggestion will still work.

     

    Set the On Change property of the Device Combobox to collect the locations of the selected devices, then concat the collection datatable into the text box.

  • Community Power Platform Member Profile Picture
    on at

    To remove duplicates you can use distinct in the textbox/label Text.

     

    Concat(Distinct(collection,Locations),Result,", ")

  • AndyH_JSY Profile Picture
    84 on at

    The issue is I am unable to collect the location names with the Collect function from the data table - 

    ClearCollect(Collection, DeviceNameInput.SelectedItems.'Device Name')     //This is only collecting the selected items in the Combo Box, whereas I would like to Collect the Items in the 'Device Location' column of the data table. 

     

    I do believe the Concat(Distinct(collection,Locations),Result,", ") will work, however, I cannot get them into the Collection first. 

     

    Trying to do ClearCollect(Collection, DataTable1.Selected.'Device Location') but it doesn't like this. 

  • Community Power Platform Member Profile Picture
    on at

    If you copied from the editor, try changing the Device Location code to SelectedItems and not Selected.  Thats what Im doing in my test and it works.  

  • AndyH_JSY Profile Picture
    84 on at

    I was trying this earlier, but for some reason SelectedItems is not an option for the DataTable?


    See attached for OnChange property. 

  • Community Power Platform Member Profile Picture
    on at

    I have the combo box set to Item Name, but I'm collecting the Brand Family of the Selected Items On Change of the combo box.

    2020-04-03_1315.png

     

    Then I'm concatenating the distinct results of my collection in to a label.

    2020-04-03_1317.png

    You can see here that there are duplicates in the collection.

    2020-04-03_1317_001.png

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard