Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Create N number of items based off text box

(0) ShareShare
ReportReport
Posted on by 8

I have a New Item form that a user fills out and enters a quantity into a text box.

The form should create N number of identical items into a SharePoint List based off the quantity box.

The submit icon uses the following OnSelect:

ForAll(FirstN([TextInput1.Text, 1,2,3,4,5,6,7,8,9,10]),Patch('General Inventory',Defaults('General Inventory'),{Title: DataCardValue5_1.Text,Barcode: DataCardValue6_1.Text,User: DataCardValue9.Selected,Notes: DataCardValue8_1.Text,Attachments: DataCardValue14}));Back()

Only a single item is created in the SharePoint list, however.

 

Categories:
  • clepere Profile Picture
    8 on at
    Re: Create N number of items based off text box

    Done. Thanks for your time. 

  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on at
    Re: Create N number of items based off text box

    @clepere 

    If they both worked you have the ability to select two answers 🙂

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • clepere Profile Picture
    8 on at
    Re: Create N number of items based off text box

    Thank you both for the suggestions! They both work like a charm!

  • Verified answer
    mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on at
    Re: Create N number of items based off text box

    @clepere 

    You could use the SEQUENCE function.  By using SEQUENCE you do not have to pre-define the number range.  The user can add as many new items as they like.

     

    ForAll(Sequence(Value(TextInput1.Text)),Patch('General Inventory',Defaults('General Inventory'),{Title: DataCardValue5_1.Text,Barcode: DataCardValue6_1.Text,User: DataCardValue9.Selected,Notes: DataCardValue8_1.Text,Attachments: DataCardValue14}));Back()
    

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Verified answer
    SimonPiquer Profile Picture
    255 on at
    Re: Create N number of items based off text box

    Hi,

     

    You almost had it, try this:

     

    ForAll(FirstN([1,2,3,4,5,6,7,8,9,10],Value(TextInput1.Text)),Patch('General Inventory',Defaults('General Inventory'),{Title: DataCardValue5_1.Text,Barcode: DataCardValue6_1.Text,User: DataCardValue9.Selected,Notes: DataCardValue8_1.Text,Attachments: DataCardValue14}));Back()

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399