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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch into separate ro...
Power Apps
Answered

Patch into separate rows from a comma separated label

(0) ShareShare
ReportReport
Posted on by 20

Hello,
I collect data that is thrown into a label which is separtated by commas.
Example: Blue, Green, Red

I have a Customer Code that I would like to assign to these (Let's say Cust1A). I would like to patch to an existing table so the table ends up looking like this:

 

Cust1ABlue
Cust1AGreen
Cust1ARed

 

I would appreciate any help. Thank you!

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @jmauras,

     

    You could use the following code (I expect 2 text columns):

    Patch(
     DataSource,
     ForAll(
     //Separated by comma and a space
     Split(Label.Text, ", "),
     //You can replace "CUST1A" with a dynamic value such as a variable
     {ColorColumn: Value, CustomerCode: "CUST1A"}
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • jmauras Profile Picture
    20 on at

    Hi @LaurensM 

    Thank you for the quick response. 

    The code goes in with no errors. However the patch isn't going through to the table. Is just the word "Value" in "ColorColumn: Value" ok? 

    Patch(GFSCompoundSpecsStaging, 
    ForAll(
     Split(CRSpecList.Text, ", "),
     {specifications: Value, compound_code: CmpdCodePull.Text}
     )
    );

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @jmauras,

     

    Split() will return the split output as a table with one column named Value. Referencing Value as the specifications column value should suffice if that column expects a text input.

     

    Although using the ForAll within your patch is preferred, we can use try an alternative for troubleshooting purposes:

    ForAll(
     Split(CRSpecList.Text, ", "),
     Patch(
     GFSCompoundSpecsStaging,
     Defaults(GFSCompoundSpecsStaging),
     {specifications: ThisRecord.Value, compound_code: CmpdCodePull.Text}
     )
    );

    Is specifications a text column and are all required columns filled in? During my testing the initial code led to new rows being created within my datasource.

     

    I hope this helps!

  • jmauras Profile Picture
    20 on at

    Hi @LaurensM 

    Those alterations worked perfectly. Just what I needed. Thank you!

     

    0QVA-A-59588
    0QVABS
    0QVAMS 3200

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard