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 / Split text and create ...
Power Apps
Answered

Split text and create a collection

(0) ShareShare
ReportReport
Posted on by 13

I need a user to add several rows in a SharePoint list though a Power app.

In the first textbox they enter the Project number (example:19212-1) (1 value)

In the second textbox the copy a text with a separator (example: YV-111;YV-112;YV-113).

 

I want to split the text and create a collection with the values:

 

Projektnumer:                                Elementnamn:

19212-1                                          YV-111

19212-1                                          YV-112

19212-1                                          YV-113

 

And then save the Collection to the SharePoint list.

 

Thanks for your help.

Pic 2.png
Pic1.png
Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @HubertWiech 

     

    We need to split the element field and use the Patch command to create multiple

     

     

    ForAll(
     Split(
     ElementInput.Text,
     ","
     ),
     Patch(
     'EK-YV',
     Defaults('EK-YV'),
     {
     Projektnummer:ProjectNumberInput.Text,
     Elementnamn: Result
     }
     )
    )

     

     

     

  • Verified answer
    eka24 Profile Picture
    20,925 on at

    You can follow these steps:

    To create the Collection, Insert a button and OnSelect:

    ClearCollect(colSplited,{Projektnumer: TextInput1.Text, Elementnamn: Split(TextInput2.Text,";")});
    ClearCollect(colSplited2,Ungroup(colSplited,"Elementnamn"))

    To Patch to the Datasource, Insert Another button with OnSelect:
    ForAll(colSplited2,
    Patch(Datasource, Defaults(Datasource),
    {Column1: Elementnamn, Column2: Projektnumer} ) )
     
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard