cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DannyRA
Level: Power Up

String to Data Table with multiple columns

Hi everyone,

I'm new to Canvas app and I need help for a basic need.

 

So I have a string stored in a label. The string has the following format : "A:1,B:2,C:3". 

I want to convert it into a data table with two columns and three rows:

ValueID
A1
B2
C3

 

I've tried with the Split function but didn't succeed to have two columns. Can someone help me please ?

 

For full context, then my goal will be to add the value column into another data table (via a join on the ID column).

 

Thanks 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: String to Data Table with multiple columns

Hi @DannyRA 

 

ForAll(Split(LabelName.Text,","),Collect(colTable,{Value:First(Split(Result,":")).Result,ID:Last(Split(Result,":")).Result}))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Dual Super User
Dual Super User

Re: String to Data Table with multiple columns

Hi @DannyRA 

 

ForAll(Split(LabelName.Text,","),Collect(colTable,{Value:First(Split(Result,":")).Result,ID:Last(Split(Result,":")).Result}))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,682)