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 III
Super User III

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.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (974)