cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
Dual Super User II
Dual Super User II

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

2 REPLIES 2
Highlighted
Dual Super User II
Dual Super User II

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

Highlighted
Frequent Visitor

Re: String to Data Table with multiple columns

Thank you.  Exactly what I was looking for.  Couldn't figure out why I was always getting a table results versus the column values.

This is a great work-around (parsing a multi-line text field that user pastes data into) in place of having an easy, on-the-fly import from Excel function.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

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

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,163)