cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mssss
Helper V
Helper V

Split my selection to table

Hello,

I am trying to split and changeing to new table.😅

Is there any way I can change like this?

change.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @mssss ,

First concatenate all your data from field1 column into a single string, then split it out into a columns again.

 

Let's assume your first column "field1" is a column from a collection called collectFields, and you want to collect the output into a column called "selection" in a collection called collectOuput.  I've tried to spread the formula out a bit so you can easily see the different parts;

ClearCollect(collectOutput,
    RenameColumns(
              Split(
                  Concat(collectFields, field1, ","), 
                  ","),
              "Result", "selection"
    )
)

Working from the inside/middle out with Concat(collectFields, field1, ",") ;

  1. We Concat() the field1 column using the "," separator, so all entries are concatenated to a single string separated by commas.
  2. We then Split() the output of the Concat() string by the "," separator, creating a single column table with each entry on a row.  The column name of our Split() output is named "Result" by default
  3. We wrap the output of the Split() function in a RenameColumns() function to rename "Result" to "selection"
  4. We collect the outputs into a collection called collectOutput

 

Hope this helps,

RT

View solution in original post

2 REPLIES 2
RusselThomas
Microsoft
Microsoft

Hi @mssss ,

First concatenate all your data from field1 column into a single string, then split it out into a columns again.

 

Let's assume your first column "field1" is a column from a collection called collectFields, and you want to collect the output into a column called "selection" in a collection called collectOuput.  I've tried to spread the formula out a bit so you can easily see the different parts;

ClearCollect(collectOutput,
    RenameColumns(
              Split(
                  Concat(collectFields, field1, ","), 
                  ","),
              "Result", "selection"
    )
)

Working from the inside/middle out with Concat(collectFields, field1, ",") ;

  1. We Concat() the field1 column using the "," separator, so all entries are concatenated to a single string separated by commas.
  2. We then Split() the output of the Concat() string by the "," separator, creating a single column table with each entry on a row.  The column name of our Split() output is named "Result" by default
  3. We wrap the output of the Split() function in a RenameColumns() function to rename "Result" to "selection"
  4. We collect the outputs into a collection called collectOutput

 

Hope this helps,

RT

View solution in original post

@RusselThomas Thank you!! Worked🤗

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (50,116)