Skip to main content

Notifications

Power Automate - Building Flows
Answered

split text from Ms Forms then add lines to table

(0) ShareShare
ReportReport
Posted on by 252

Hi 

 

I have a form that users can enter a multiple lines of text, up to 50 Lines.  I would like to each line to an excel table.  Is this possible?

 

  • Skybluekid Profile Picture
    Skybluekid 252 on at
    Re: split text from Ms Forms then add lines to table

    Thank you it worked a treat

  • Verified answer
    rzaneti Profile Picture
    rzaneti 3,365 on at
    Re: split text from Ms Forms then add lines to table

    Hi @Skybluekid ,

     

    You will need to transform your form question answer into an array and loop it. Check the process below.

     

    Excel table

    For this example, we will populate this empty table:

    rzaneti_0-1690235445330.png

     

    Dummy Text 

    For this example, I'm using the text below, stored in a string variable. In the following steps, you can replace the string variable for your Form answer dynamic content.

    rzaneti_1-1690235507990.png

     

    Step 1 - Split the text:

    Initialize an array variable and store the following expression:  split(variables('original_text'), decodeUriComponent('%0A')). This expression is splitting your text by line break:

    rzaneti_2-1690235583955.png

     

    The array will look like this:

    rzaneti_3-1690235627247.png

     

    Step 2 - Loop array:

    Use your array as input to an 'Apply to each' loop. Inside the loop, insert an 'Add row into a table' action, populate the file and table details and, in the relevant field (in my case, 'value'), include the dynamic content of the 'Current item' from 'Apply to each' action:

    rzaneti_5-1690235715871.png

     

    Output:

    After run the flow, this will be your output (the empty record at row 2 already existed when I created the table): 

    rzaneti_6-1690235780936.png

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    https://digitalmill.net/

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard