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 / Looking for assistance...
Power Apps
Unanswered

Looking for assistance on saving multiple records with two different controls

(0) ShareShare
ReportReport
Posted on by 63

I am just starting out with PowerApps (i.e., about 2 weeks) and am trying to do a proof of concept where I can select a single value from a list and multiple values from a list, gallery, combobox, etc. and save multiple records (i.e., not concatenate) to the dataverse table.  I have started looking at PowerApps 911 tutorials and have started understanding the collection and patch features.  So far I am able to patch a single selection from both controls but not a single selection from one and multiple from the other as intended. 

 

This YouTube video captures what I am trying to do, but I have not figured out where he is starting from in order to execute what he is demonstrating:  PowerApps use Collect to submit multiple rows of data to your data source - YouTube

 

Thanks for any help you can provide on getting me started!

Categories:
I have the same question (0)
  • turnerj3 Profile Picture
    2,039 on at

    @jpwintz ,

    In order to Patch multiple you would need to use a ForAll.

    From a gallery you could use this to send gallery items to a collection

    ForAll(Gallery1.AllItems,Collect(col1,{Column1:'Created By'.DisplayName,Column2:Textbox1.Text}))

    This would create new list items with a patch:

    ForAll(Gallery2.AllItems,Patch(SPList,Defaults(SPList){Title:YourData,ListColumn1:'Created By'.DisplayName,ListColumn2:File}))

     

    You could do similiar by Collecting all the data first then Patching the collection to a list.

     

    I hope this helps.

  • jpwintz Profile Picture
    63 on at

    I am tracking on the ForAll and Patch.  In my setup, I have 3 tables.  Two are lookup tables and one is the merge/join table that records the results.  I want to be able to select a single item from one table (gallery, listbox, etc) and multiple items from another table and save the dataset to the third table for each of the multiple selections involved.

  • turnerj3 Profile Picture
    2,039 on at

    Will each item that you want to select go in a specific column in the 3rd table?

  • jpwintz Profile Picture
    63 on at

    Yes - I have attached a screen shot to kind of show what I am doing.  The two tables on the far right (A and B) are my two lookup tables).  I am picking one A value and multiple B values.  They should save to a corresponding row in the join table on the far left of the screen.

    Annotation 2023-06-20 160426.png
  • turnerj3 Profile Picture
    2,039 on at

    In this example you are wanting to create 3 new rows containing

    black/artistic

    black/cool

    black/dark?

    or one record like black/artistic, cool, dark?

  • jpwintz Profile Picture
    63 on at

    I want three records:

    black/artistic

    black/cool

    black/dark

  • turnerj3 Profile Picture
    2,039 on at

    @jpwintz ,

    Here is an example. I created a collection from combobox with types from a table for your 3rd table. A data table where I selected the color record like your 2nd table and then patched to my first table.

     

    ClearCollect(col7,ComboBox3.SelectedItems);
    ForAll(col7, Patch(Photos,Defaults(Photos),{Title:1,Url:DataTable1_1.Selected.color ,Figure:ThisRecord.type}))

     

    col7 is my collection. Photos is my list, your table. You will need to change to your columns and your selections.

  • jpwintz Profile Picture
    63 on at

    PowerApps is not liking how I have had to adapt your formula for my tables:

    ClearCollect(col7,lstB.SelectedItems);
    ForAll(col7, Patch('JPW JoinABS', Defaults('JPW JoinABS'), {A: lstA.Selected.'ID-A', B: 'ID-B'}))

     

    lstA is a single select listbox that includes the color names.  The columns are ID-A and Color Name.

    lstB is a multi select listbox that includes the color types.  The columns are ID-B and Color Type

    The Join Table has an autogenerated ID and columns A and B which are linked to the lD values above and translated to the visible name.

  • turnerj3 Profile Picture
    2,039 on at

    What error is it giving for this?

  • jpwintz Profile Picture
    63 on at

    Attached are my errors and the red line under the code

    Annotation 2023-06-21 134755.png
    Annotation 2023-06-21 134756.png

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard