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 / Multiline Text separat...
Power Apps
Answered

Multiline Text separation to rows

(0) ShareShare
ReportReport
Posted on by 58

I'm looking to be able to input multiple lines in my text box and then have them transfer to the data as separate rows, can anyone assist?

JuanGarcia9_0-1705942183732.png

the issue I'm having is when adding multiple accounts it only adds to the local collection as on entry?

Categories:
I have the same question (0)
  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi @JuanGarcia9 

     

    Splitting them into separate rows, you can do this

    Add the following to a gallery control to see how it works.
    Items =  
    Filter(
            Split(TextInput1.Text, Char(10)),
            Not IsBlank(Trim(Value))
        )
    Char(10) is the newline character and check for the start of a new line.
    Not IsBlank(Trim(Value)) remove any blank lines.
     
    Result
    rubin_boer_0-1705943544054.png

     

    If you want to achieve this: 

    rubin_boer_0-1705944193986.png

    add a button and add this to it:

    ClearCollect(
        someCollection,
        Filter(
            Split(TextInput1.Text,Char(10)),
            Not IsBlank(Trim(Value))
        )
    );

    ClearCollect(
        colDoIt,
        ForAll(someCollection,{col1: Value, col2: TextInput2.Text, col3: TextInput3.Text})
        )
     
    Set the Items of the datatable as DoIt
  • JuanGarcia9 Profile Picture
    58 on at

    Hey Rubin,

     

     I apologize for my ignorance I am fairly new to this, can you explain how I would add to this formula?

    JuanGarcia9_0-1705944044870.png

    JuanGarcia9_1-1705944166890.png

    when I hit the transfer button, I want it to separate multiple entries in the chart to the right?

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    @JuanGarcia9 

    have a look at this:

    doit.gif

     

  • JuanGarcia9 Profile Picture
    58 on at

    I apologize again, I want all 4 inputs to have the capability of multi entries.

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi @JuanGarcia9 

     

    that all good.

     

    Can you give an example where you have the multiple lines in those textboxes and how you then expect the output to be:

     

    AA | BB | CC | EE

    BB | BB 

    CC | BB

  • JuanGarcia9 Profile Picture
    58 on at

    Hey Rubin, 

     

    I'm looking to make multiple entries in the text boxes and have them transfer into separate rows;

     

    JuanGarcia9_1-1705949800392.png

     

    so if each text box, account ID/BPM ID/Resp cent/Admin have multiple entries, I want them to transfer as separate rows,

    formatted as below in sequential order;

    A

    A

    B

    B

    C

    C

    D

    D

    also can you explain the coldoit part of the formula?

  • JuanGarcia9 Profile Picture
    58 on at

    Woops I'm sorry the format is wrong in the above response, I meant,

    A B C D

    A B C D

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    cool, tnx, will the boxes always have the same number of rows?

  • JuanGarcia9 Profile Picture
    58 on at

    Yes they should always have the same amount of rows

  • Verified answer
    rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

     

    ok here is one way:

    add a button and add this code to OnSelect:

    //create temp collection to collect all of the split rows
    ClearCollect(colAccountId,Filter(Split(TextInput1.Text,Char(10)), Not IsBlank(Trim(Value))));
    ClearCollect(colBpmId,Filter(Split(TextInput2.Text,Char(10)), Not IsBlank(Trim(Value))));
    ClearCollect(colRespCent,Filter(Split(TextInput3.Text,Char(10)), Not IsBlank(Trim(Value))));
    ClearCollect(colAdmin,Filter(Split(TextInput4.Text,Char(10)), Not IsBlank(Trim(Value))));

    //collect the sequence as required

    ClearCollect(
        colDoIt,
        //now for every column lets add the text inputs data from the other ones
        ForAll(
            Sequence(CountRows(colAccountId)),
            {
                AccountId: Index(colAccountId,Value).Value,
                BpmId: Index(colBpmId,Value).Value,
                RespCent: Index(colRespCent,Value).Value,
                Admin: Index(colAdmin,Value).Value
            }
        )
    )
     
    Result
    doit.gif

     

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