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 / Help with Form via pow...
Power Apps
Suggested Answer

Help with Form via power app submission

(1) ShareShare
ReportReport
Posted on by 2
in my power app i have a container that has a form and a gallery. the aim is so that when i press my submit button, the app creates an item in a sharepoint list. the app is able to create multiple rows in a sharepoint list thanks to the gallery, but my hope is that for each new item created by my the gallery, the filled out form fields remain constant for that row example: my sharepoint list has 10 columns, 5 are linked by the form, 5 by the gallery. if i have for example 5 items created in my gallery when i currently press submit, in my sharepoint list it creates 1 row with the forms fields and 5 rows with the gallery fileds. i would like it so the form fields are common to all of the gallery created rows. Thank you
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @CG-26021615-0
     
    Form (SubmitForm()) can only create one record at a time. That’s why you’re getting twice row one from gallery and another from form as you are not updating the just creating. So if you need to create multiple records (one for each gallery row) and include the same form values in each of them, you need to handle everything inside a ForAll() loop and use Patch() to create the records.

    For example:

    ForAll(
        Gallery.AllItems As _obj,
        Patch(
            ListName, //ListName - your list name
            Default(ListName),
            {
                FieldName1: _obj.GalleryTextInput.Text,
                FieldName2: _obj.GalleryTextInput2.Text, //FieldName2 - your fieldnames
                ChoiceField: {Value: _obj.GalleryCombobox.Selected.Value},
                FieldName4: FormTextInput.Text,
                FieldName5: FormTextInput2.Text 
            }
        )
    );
    
    //ForAll(Gallery.AllItems As _obj, …) - This loops through each row in the Gallery. And _obj this is just a temporary name for the current gallery row being processed. So when you write:
    //_obj.GalleryTextInput.Text
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    Firstly @Kalathiya is correct with the solution to the issue, so please mark accordingly. 
     
    I will add something here for the purposes of efficiency - ForAll is not designed to be a loop, although it can act that way if it contains an action inside it. ForAll creates a Table, which can be Patched in one action to the data source and will run much faster than individual Patches for each record. If it contains the ID of each record, it will update the specific records, if not it will (as in your case) create new records.
    Patch(
       ListName, 
       ForAll(
          Gallery.AllItems As _obj,
          {
             FieldName1: _obj.GalleryTextInput.Text,
             FieldName2: _obj.GalleryTextInput2.Text, //FieldName2 - your fieldnames
             ChoiceField: {Value: _obj.GalleryCombobox.Selected.Value},
             FieldName4: FormTextInput.Text,
             FieldName5: FormTextInput2.Text 
          }
       )
    );
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard