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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,736)