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 Automate / Add Multiple Rows to t...
Power Automate
Answered

Add Multiple Rows to table based off of form answer

(0) ShareShare
ReportReport
Posted on by 35

I have a form that asks how many loads do you want to request, would there be  a way in this example to add 4 rows of data with the same information on all 4?  I get the following error when trying to run.

 

THanks,

 

Myatt42_2-1649271600289.png

 

Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Myatt42 

     

    Just wrap your answer in the json() expression and it will be treated as an array, rather than a string.

     

    Please consider accepting my answer as a solution if it helps to solve your problem.

    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

  • Myatt42 Profile Picture
    35 on at

    Myatt42_0-1649278490806.png

     

    Sorry where would I put that?

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Myatt42 

     

    In the select item from previous step. As seen here https://youtu.be/8_iBkw3bH8A?t=300.

     

    Damien

     

  • Myatt42 Profile Picture
    35 on at

    The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@json(outputs('Get_response_details')?['body/r6c8be98b16774ea0a80dee1b3e14baaf'])' is of type 'Integer'. The result must be a valid array.

  • Myatt42 Profile Picture
    35 on at

    Im only getting them to enter 1 number...  anywhere from 1 to 20.

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Myatt42 

     

    I’ve misunderstood. I thought you hid the array of multiple answers as there are 4, but you have an integer 4 and want 4 rows as a result. So, what you want is range(1,answer) as the input to the apply to each. It will loop 4 times and repeat the add row action. Apologies.

     

    Damien

  • Myatt42 Profile Picture
    35 on at

    No worries, I apologize for all the questions.  

    I now get this message

     

    Unable to process template language expressions for action 'Apply_to_each' at line '0' and column '0': 'The template language function 'range' expects two integer parameters: an inclisive start index of the range as the first parameter and a count of integers to return as the second parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#range for usage details.'.

     

     

    Myatt42_0-1649279971551.png

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Myatt42 

     

    This is what you are looking for:

     

    DamoBird365_1-1649332153402.png

     

    The error indicates that your range only has one parameter?  

     

    Damien

  • Myatt42 Profile Picture
    35 on at

    Heres what i have....  

     

    range(1,outputs('Get_response_details')?['body/r6c8be98b16774ea0a80dee1b3e14baaf'])

    Myatt42_0-1649333406648.png

     

     

  • Myatt42 Profile Picture
    35 on at

    any thoughts @DamoBird365 

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard