cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DannyRA
Regular Visitor

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

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

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,441)