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 / How to submit multiple...
Power Apps
Answered

How to submit multiple records to a SharePoint list

(0) ShareShare
ReportReport
Posted on by 28

I don't know if PowerApps is just awful or if I am missing something obvious, but I just cannot figure this out.

I have a PA with a location combo box. Users can select one or multiple locations. There are then a bunch of other fields that they fill out as well. I have a button at the end that I want to, when pressed, create one new record in a SP list for each location selected in the combo box, each having the same values for all the other fields.

 

So for example, if someone filled out the fields as follows:
Locations: Main Street, Broad Street, 1st Street

Date: 1/2/2024
Contact: John Smith

Phone: 867-5309

 

It would create three records in SP:

Main Street  |  1/2/2024  |  John Smith  |  867-5309

Broad Street  |  1/2/2024  |  John Smith  |  867-5309

1st Street  |  1/2/2024  |  John Smith  |  867-5309

 

How on Earth do I accomplish this? It seems like it should be a common/basic command, but if it is I am blind.

Categories:
I have the same question (0)
  • Verified answer
    Prabhakar_S Profile Picture
    735 Moderator on at

    Hi @DeanM1985 ,

     

    To achieve this in PowerApps, you can use the Patch function to create records in your SharePoint list for each selected location. Assuming you have a SharePoint list called "YourSharePointList" with fields: Location, Date, Contact, Phone. Get the selected locations from the combo box.

     

    Set(selectedLocations, ComboBox_Locations.SelectedItems);

    // Loop through each selected location and create a new record in the SharePoint list

    ForAll(selectedLocations,
    Patch(
    YourSharePointList,
    Defaults(YourSharePointList),
    {
    Location: ThisRecord.Value, // Assuming the combo box items are in a column called Value
    Date: DatePicker_Date.SelectedDate,
    Contact: TextInput_Contact.Text,
    Phone: TextInput_Phone.Text
    }
    )
    );

     

    Make sure to adjust the field names and control names according to your app. The key is to use the 'ForAll' function to iterate through the selected locations and use 'Patch' to create a new record for each location in the SharePoint list.

     

    Thanks!!!

     

    Please consider marking my response as the accepted solution if it successfully resolves your concern. If you found the information beneficial in other aspects, kindly express your appreciation by giving it a thumbs-up.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard