web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / String to Data Table w...
Power Apps
Unanswered

String to Data Table with multiple columns

(0) ShareShare
ReportReport
Posted on by 2

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 🙂

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,143 on at

    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

  • hexparker Profile Picture
    18 on at

    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.

  • ChuckQ Profile Picture
    Microsoft Employee on at

    In case someone else need to do this in a function dynamically where Collect() is not an option (i.e. neck-deep in a ForAll, eyeball-deep in multiple Withs()s):
    Screenshot 2022-06-13 190752.jpg

    DropColumns(
    AddColumns(
    Split(
    "A:1,B:2,C:3", //the original text
    ","
    ),
    "Value",
    First(
    Split(
    ThisRecord.Result,
    ":"
    )
    ).Result,
    "ID",
    Last(
    Split(
    ThisRecord.Result,
    ":"
    )
    ).Result
    ),
    "Result"
    )

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard