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 Automate / I want to create multi...
Power Automate
Unanswered

I want to create multiple rows in a table in excel based on qty entered into a form, any suggestions?

(0) ShareShare
ReportReport
Posted on by 47

As the title says, I am looking to add a number of identical rows to a table in excel based on the qty entered into a form that also captures the rest of the data that will be building that row. For example, form captures order data and a quantity, then the flow adds rows to a table in excel equal to the number entered into the quantity field on the form.

 

Grateful for any help I can get.

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

    Hi @adam0s 

     

    You could use the expression range on an apply to each.

     

    Range creates an array of numbers from start to finish i.e. 1 to number of rows.

     

    DamoBird365_0-1620233662352.png

    So in the above example I received 4 via the compose and it added 4 identical rows.

     

    DamoBird365_1-1620233699872.png

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

     

     

  • adam0s Profile Picture
    47 on at

    Thank you for the response @DamoBird365 This looks like the start of what I need but I am unsure of how to relate it to my input, in this case I do not always want it to create the same number of identical rows, there is a field in the initial form trigger that specifies a quantity, how can I use your solution with that field so that each time the form is submitted it will produce a number of rows equal to the quantity entered on the form?

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @adam0s 

     

    The above example is dynamic.  It creates a range from 1 to the dynamic value albeit in my example the value is fixed at 4.  If you replace the 4 with your answer from the form, it will run from 1 to the dynamic answer provided.

     

    Hope that makes sense.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • adam0s Profile Picture
    47 on at

    It does, I think where I am still stuck is in creating the range in the apply to each, can you show me exactly what you put there?

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @adam0s 

     

    It's sneakily visible on the screenshot as a comment.  

     

    range(1,outputs('compose'))

     

    but you can replace the outputs('compose') with the dynamic value for the form field or stick your form field into a compose, whatever you feel more confident with.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • adam0s Profile Picture
    47 on at

    I see it now, totally missed it.

    Ok, I added the dynamic content to the compose and I am getting the following error:

    adam0s_0-1620242169957.png

    so the compose is getting the right number from my test form fill, I have tried both 

    range(1,outputs('Compose'))
    and
    range(1,outputs('Get_response_details')?['body/r76acd7a9c92e48a4bd69112bb4f5dd07'])
    which is what it enters when I add the dynamic content to this step directly and I get that error either way, is this a syntax error or am I missing something?
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @adam0s 

     

    Almost there.  The data from your form is returned as a string, I didn't think of that one.  You need to use the expression int().

     

    i.e.

     

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

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • adam0s Profile Picture
    47 on at

    Yes, that worked! I have accepted your original post as the solution. Thank you for your help!

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard