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 / Patch new record(s) ba...
Power Apps
Answered

Patch new record(s) based on a combo box?

(0) ShareShare
ReportReport
Posted on by

Can you create new Sharepoint records based on a combobox?

 

Patch(ListName,

 

{Task Name:Dropdown1.selected,

Person:combo_box1.selecteditems.result,

Department:dropdown4.selected})

 

 

the person value is a dropdown list of names on sharepoint

Categories:
I have the same question (0)
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    You can use a ComboBox to drive a Patch(), but keep in mind SelectedItems is a table with potentially multiple entries - your Patch() needs to handle this. Syntax will look more like:

    ForAll(combo_box1.SelectedItems As aItem,
     Patch(ListName,Defaults(ListName),
     {
     TaskName: Dropdown1.Selected.Text,
     Person: aItem.Result // Assuming this is a single line of text column
     Department: Dropdown4.Selected.Text
     }
     )
    )

    Hope that helps,

    Bryan

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Yes you can, but depends on your SharePoint list column settings. If it's a person field, then you'll need to allow multiple people on the column. I can't remember if powerapps will convert that or not automatically, but you'll want to make sure that's enabled on the column, then update the schema / save reload your app, then use the combobox.selecteditems only not .results, it should respect the multiple selection. 

     

    If it's another column type then you'll have to use concat etc. to concatenate the .selecteditems from the table as suggested in previous reply.

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @marc2510,

    Do you want to save multi select Combo Box items to Person column?

    Could you please tell me that if the Person column is a Text column in the SP list?

     

    I assume that the Person column is a single line of text column, please modify your formula as below:

    Patch(ListName,
    
    {Task Name:Dropdown1.selected,
    
    Person:Concat(combo_box1.SelectedItems,Result,",")
    
    Department:dropdown4.selected})
  • Stacey_T Profile Picture
    60 on at

    Is it possible to have the Patch function create the number of records equivalent to the number of selections in the combobox, i.e. one new record per selection?  The solution seems to put my multiple selections into one row/one field.  

    ForAll(combobox.SelectedItems As alias, 
    Patch(SP_list, Defaults(SP_list),
    {alias_test_field: alias.Result}));

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard