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 N number of ite...
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:
I have the same question (0)
  • Verified answer
    SimonPiquer Profile Picture
    255 on at

    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()
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @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."

  • clepere Profile Picture
    8 on at

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

  • mdevaney Profile Picture
    29,991 Moderator on at

    @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

    Done. Thanks for your time. 

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard