cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Patch Multiple select combobox values as different line items in sharepoint list

Hi All,

 

i have a fairly simple requirement that i would want to capture. I have a Add new record form which has 4 columns. Now my user wants to select multiple values in region column which is a combo box in the power apps form but in the sharepoint list it is a single line text. 

When the user selects multiple values and enters other fields too and hits save , i would want to create a separate line item or a record for each combo box value in sharepoint.

Now i am trying to use patch to create the records but it does not seem to work, please find the code below; The Region column is the one with multiple selected values . if i put in the code as combobox6.selecteditems.value it gives me an error saying "The type for region is text. found Table" 

ForAll(
    ComboBox6.SelectedItems,
    Patch(
        PPN,
        Defaults(PPN),
        {
            Title: ppnnewitem.Text,
            Region: ComboBox6,
            ProgramName: programnameppn.Text,
            ProjectClassification: projectclassificationnewppn.Selected.Value
        }
    )
);

 Would really appreciate if someone could help me out in this.

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @Anonymous ,

I think I was close (not on PC at the time) try this

ForAll(
   ComboBox6.SelectedItems,
   Patch(
      PPN,
      Defaults(PPN),
      {
         Title: ppnnewitem.Text,
         Region: Value,
         ProgramName: programnameppn.Text,
         ProjectClassification: projectclassificationnewppn.Selected.Value
     }
   )
)

 

Please click Accept as solution 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 giving it Thumbs Up.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @Anonymous ,

I cannot test this at the moment, but try

ForAll(
    ComboBox6.SelectedItems,
    Patch(
        PPN,
        Defaults(PPN),
        {
            Title: ppnnewitem.Text,
            Region: ComboBox6.Value,
            ProgramName: programnameppn.Text,
            ProjectClassification: projectclassificationnewppn.Selected.Value
        }
    )
)

 

Please click Accept as solution 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 giving it Thumbs Up.

Anonymous
Not applicable

@WarrenBelz  There is no property Value for coxcombox6 unless i use selected or selecteditems.

When i use selected it gives me the first selected item and when i select Selecteditems it gives me an error for record type.

Thanks @Anonymous ,

I think I was close (not on PC at the time) try this

ForAll(
   ComboBox6.SelectedItems,
   Patch(
      PPN,
      Defaults(PPN),
      {
         Title: ppnnewitem.Text,
         Region: Value,
         ProgramName: programnameppn.Text,
         ProjectClassification: projectclassificationnewppn.Selected.Value
     }
   )
)

 

Please click Accept as solution 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 giving it Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,822)