Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 2cJA5U27nUJysJ7lln8wqU
Power Apps - Building Power Apps
Answered

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

Like (0) ShareShare
ReportReport
Posted on 3 Apr 2020 16:01:45 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:
  • Community Power Platform Member Profile Picture
    on 03 Apr 2020 at 18:21:43
    Re: Concat/Concatenate a single column of a data table with multiple columns

    Excellent.  I'm glad I could help.

  • AndyH_JSY Profile Picture
    84 on 03 Apr 2020 at 18:20:50
    Re: Concat/Concatenate a single column of a data table with multiple columns

    Thank you very much for your help Sir!

     

    You have solved my 8+hrs of hair pulling!


    Thank you very much!!

  • Verified answer
    Community Power Platform Member Profile Picture
    on 03 Apr 2020 at 18:16:39
    Re: Concat/Concatenate a single column of a data table with multiple columns

    Just remove the distinct column from Items.  .'Device Name'

     

    Set Device Name as the Display and Search Fields.

    2020-04-03_1342.png

  • AndyH_JSY Profile Picture
    84 on 03 Apr 2020 at 18:12:13
    Re: Concat/Concatenate a single column of a data table with multiple columns

    lol I feel like we are getting somewhere! Thanks for your help so far its really appricated!

     

    The Items field of the 'Please select the devices(s):' box is the attachment Capture.png. The 'BackendDatabase' is the Excel sheet and we are only collecting the 'Device Name' field. So technically your code works, but I am unable to collect the 'Device Location' Field on the OnChange property!

     

    If I can have it link the Device Name to Location Name in the background then we've got it!

     

  • Community Power Platform Member Profile Picture
    on 03 Apr 2020 at 18:01:12
    Re: Concat/Concatenate a single column of a data table with multiple columns

    Im not sure of anything...lol

     

    Try this...

     

    In your combobox On Change property:  ClearCollect(Collection, DeviceNameInput.SelectedItems.'Device Location')

     

    In your textbox/label Text property:  Concat(Distinct(Collection, 'Device Location'),Result,", ")

  • AndyH_JSY Profile Picture
    84 on 03 Apr 2020 at 17:53:05
    Re: Concat/Concatenate a single column of a data table with multiple columns

    I am using a standard Data Table within PowerApps called 'DataTable1', DataTable1's data source is a OneDrive Excel file 

     

    One the main screen I have a ComboBox saying 'What is the customer name'. This filters the Data Table to only show rows for that customer. (Attachment Capture.png).

     

    So now I have a list of locations in DataTable1, in column 'Device Location'. 

     

    Those just need to be displayed in the text box, A, B, C, D etc. Are you sure Collecting the ComboBox is correct for this scenario? It seems my only option is to collect the 'Device Location' field in the DataTable1, but I am not sure this is possible?

     

    (Attachment Capture1.png) shows the questions. The 'Please select the device(s)' field is also grabbing directly from the Excel data source and not the Power Apps 'DataTable1'.

     

     

  • Community Power Platform Member Profile Picture
    on 03 Apr 2020 at 17:40:35
    Re: Concat/Concatenate a single column of a data table with multiple columns

    Its all from the same SQL table, but you arent collecting from the datasource necessarily, you're collecting from the combobox selected items.  In your previous post you were trying to collect from your datatable directly.

  • AndyH_JSY Profile Picture
    84 on 03 Apr 2020 at 17:36:13
    Re: Concat/Concatenate a single column of a data table with multiple columns
    Spoiler (Highlight to read)
     
     

    What is your data source of the brand family data table and also the combo box?

     

    I wonder if perhaps I cannot do the SelectedItems because it is a multi-column table?

     

    EDIT: It seems even when using a single column data table I still cannot set the Item property of the combo box to 'Device Location'

  • Community Power Platform Member Profile Picture
    on 03 Apr 2020 at 17:26:09
    Re: Concat/Concatenate a single column of a data table with multiple columns

    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

  • AndyH_JSY Profile Picture
    84 on 03 Apr 2020 at 17:26:02
    Re: Concat/Concatenate a single column of a data table with multiple columns

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


    See attached for OnChange property. 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 58 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 36

Overall leaderboard
Loading started