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 Apps / Create N number of ite...
Power Apps
Unanswered

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,989 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,989 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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard