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 / Create multiple ShareP...
Power Apps
Answered

Create multiple SharePoint line items based on quantity field in Power App form

(0) ShareShare
ReportReport
Posted on by 50

Hello, 

 

I am attempting to create an order form for certain types of equipment. Within the order form, there is a quantity datacard that is formatted as a number input via a SharePoint list. The action I am trying to achieve is that when the form is submitted, based on the quantity field create a line item. I do not want to have the user submit multiple forms to achieve their desired quantity. 

Example:

Quantity = 3

3 new line items are created in SharePoint list when the form is submitted (all information stays the same)

 

Thank you, 

 

Dylan

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @dmichel729 

    You would need to share more information about your data, but I will assume that it is that you have a form and you want multiple records created based on all the data in the form submitted.

     

    If that is the case, consider putting the following formula in your OnSuccess action of the form:

    Collect(yourDataSource,
     ForAll(Sequence(Value(yourTextInputControl.Text)-1) // Note, minus 1 because you already submitted one
     Patch(Self.LastSubmit, {ID: Blank()})
    )

    This will create multiple records based on what was entered in the textinput control and will be duplicates of the existing submitted record.

     

    I hope this is helpful for you.

  • dmichel729 Profile Picture
    50 on at

    Hi Randy, 

     

    Thank you for the insight! I appreciate your response.

     

    However, when I place the formula in the OnSuccess, I receive an error message. Below is the formula I am using. Any idea what I am doing wrong?

     

    Collect('Cable Trench Form',
    ForAll(Sequence(Value(Quantity_DataCard3.Text)-1)
    Patch(Self.LastSubmit, {ID: Blank()})

    )

    dmichel729_0-1634742567838.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @dmichel729 

    Sorry...I missed a comma in the formula.  Should be:

    Collect('Cable Trench Form',
     ForAll(Sequence(Value(Quantity_DataCard3.Text)-1), // Note, minus 1 because you already submitted one
     Patch(Self.LastSubmit, {ID: Blank()})
    )
  • dmichel729 Profile Picture
    50 on at

    Thank you again Randy. It seems there is still an error. Perhaps because Quantity_DataCard3 is a numerical field and not text? Just a guess.

     

    dmichel729_0-1634749156588.png

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @dmichel729 

    Oh goodness...smack me on the head!!  Another typo in it.  Please scrub through the formulas I provide as I type them by hand without the aid of a design editor.

    The formula SHOULD be:

    Collect('Cable Trench Form',
     ForAll(Sequence(Value(Quantity_DataCard3.Text)-1), // Note, minus 1 because you already submitted one
     Patch(Self.LastSubmit, {ID: Blank()})
     )
    )

    Was missing a closing paren 🙄

  • dmichel729 Profile Picture
    50 on at

    Thank you again for your quick response. I tried that formula as well and it is producing another error...

     

    dmichel729_0-1634753813675.png

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @dmichel729 

    Okay...the syntax is correct now at least!  

    So in your formula (I took control names from your original) you have Quantity_DataCard1 in it.  Is that your control name or is it the datacard name?  It needs to be the name of the text input control you have in your form.

  • dmichel729 Profile Picture
    50 on at

    Originally I was using the Data Card name (Quantity_DataCard3) however the text input's label is DataCardValue120 and that still produces an error. 

     

     

    dmichel729_0-1634815339406.png    

    dmichel729_1-1634815366994.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @dmichel729 

    Can you hover your pointer over the red underlined formula and see what the actual error message is?

  • dmichel729 Profile Picture
    50 on at

    dmichel729_0-1634901490563.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard