cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
itsmeqp
Advocate III
Advocate III

Concatenating Column Values to String

I am looking for a way to concatenation/join the values of a column from a table to generate a single string of text

 

Say I had a collection with 3 values in column Result:

 

Result

  • dog
  • cat
  • bird

 

I would like to concatenate those values and using semi-colon as a delimiter to create a text value of dog;cat;bird;

 

I tried using Concat and ForAll but can't seem to find a way to make it work.

1 ACCEPTED SOLUTION

Accepted Solutions
itsmeqp
Advocate III
Advocate III
9 REPLIES 9
itsmeqp
Advocate III
Advocate III
Anonymous
Not applicable

I can't access this link! How did you do it!!??

Antonima
Microsoft
Microsoft

Concat([your table], [your column] & ";")

How do I do this if I don't have any columns?
I have a string "1,2,3,4,5"

I used split to get it into a collection to display in a lisbox. 
Set(itemNumbers, TrimEnds( Split( gallery.Selected.ItemNumbers, ",") ))
I later want to get all the selected items back into a new flat string. Ex: "1,2,5"

How can I do this?

You can try to save your selected Items as a Collection and assisgn a Column Name.

To check, you can add a Label and a Button

then Use this on OnSelect Property of the button (e.g Save Button):

Set(CollectedItems, Concat([your table], [your column] & ","))

On the Label set the Text Property to:


CollectedItems

Hi, 

I am trying to do something similar, only my collection includes one or more objects, as the underlying data source is a choice column. For this reason, the proposed code is not working for me:

Set(VarTest, Concat(Collection, ProductName)

The error sais "Invalid argument type (Table). Expecting Text value instead"

Capture.PNG

How can I generate a string from the content/objects in this collection? 

Anyone? 

Anonymous
Not applicable

Have you tried to use ProductName.Value?

Set(VarTest, Concat(Collection, ProductName.Value))

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,461)