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 needed with form
Power Apps
Unanswered

Help needed with form

(0) ShareShare
ReportReport
Posted on by 4

Hello!
I'm trying to create a form page which inserts multiple rows into a Sharepoint list. Based on which Business Unit the user chooses, the number of regions in the form changes. One region equals 4 fields. For example, one BU may have 3 regions x 4 fields, another may have 10 regions x 4 fields.
I want to loop these based on the information about the BU available in a Sharepoint list, although it seems impossible to do so in a simple form.

I've tried to use a gallery to loop the regions, then insert 4 text inputs per region. The save button uses a ForAll() and a Patch() to insert the inputs into the Sharepoint list. This solution doesn't work.

 

ForAll(Gallery1.AllItems;
 Patch('Weekly Report';
 Defaults('Weekly Report');{
 'Value1':TextInput1;
 'Value2':TextInput2; 
 'Value3':TextInput3; 
 'Value4':TextInput4;
 'WeekNum':Dropdown1;
 'Business Unit':Label1
 }
 )
);;

Skärmklipp.PNGCan you help me find a solution to this? 

 

Many thanks!

Categories:
I have the same question (0)
  • SoPatt Profile Picture
    Microsoft Employee on at

    I'm not clear on exactly what you're doing but could it be as simple as that you need to use "TextInput1.Text" and "DropDown1.Selected.Value" etc.?

  • Erimar Profile Picture
    4 on at

    I have already tried this without success, unfortunately. But thanks for the help.

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

    @Erimar 

    You need to specify the properties for those controls as @sopatte mentioned.

    Your formula would be this:

    ForAll(Gallery1.AllItems;
     Patch('Weekly Report';
     Defaults('Weekly Report');{
     'Value1':TextInput1.Text;
     'Value2':TextInput2.Text; 
     'Value3':TextInput3.Text; 
     'Value4':TextInput4.Text;
     'WeekNum': Dropdown1.Selected.Value;
     'Business Unit':Label1.Text
     }
     )
    );;

    If you are having some sort of error appear or other issue, please post back.

     

    I hope this is helpful.

  • SoPatt Profile Picture
    Microsoft Employee on at

    Oh, I just figured out that TextInput1, TextInput2, etc. are all controls in the gallery and you're trying to iterate through the gallery items and get the value from the controls which are repeated.

     

    I've never seen that before, but it might work if you use the field names instead of the control names. So if TextInput1 is connected to Field1, you might try substituting Field1 for TextInput1 in your code.

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

    @sopatte 

    Yes, that does work and is intended.  If you have a control in the gallery, it becomes part of the record of the AllItems.

    So in the case of @Erimar the syntax is correct if the intention is to gather the values of the controls in the gallery associated with the item.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard