cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
neill_long
Resolver III
Resolver III

Patch combo items in collection to SP List

I am trying to Patch a collection to a SP List but having issues with the items which have been collected from a combo box.

 

Basically, i am looking to Patch the contents from this:

 

neill_long_0-1614026368309.png                       

neill_long_1-1614026409184.png

 

Trying to get the items to store in a LookUp field in my SP list.  This is the Patch formula i have:

 

ForAll(
HubRequests, 
Patch(
NEWLDREquipment, 
Defaults(NEWLDREquipment), 
{StaffName: Name, Email: Email, Department: Department, CourseCode: CourseCode, LecturerResponsible: Lecturer, Title: Location, NumberRequired: NumberRequired, StartDate: StartDate, StartTime: StartTime, EndTime: EndTime, Recurring: Recurring, EndDate: EndDate, HubType: HubTypeSession, Block: Block, Room: Room, Sessions: FTSessions, Notes: Notes, BookingType: Type}
)
)

 

The issue is with the 'Sessions: FTSessions' part of the formula.

 

Is this possible, and if so, how do I achieve this?

 

thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @neill_long ,

The syntax is valid for patching to a multi-value field - I am surprised it did not work for you. I might have the values slightly wrong as I cannot see you model. You can get back the values into a table with 

Split(Sessions,",")

 

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

6 REPLIES 6
Anonymous
Not applicable

Hi,

 

So just to confirm the column Sessions is a LookUp column and your Combobox is essentially hooked up to the same List that the LookUp column does?

Yes that is correct

Anonymous
Not applicable

In that case I had to build out the schema that it was whinging about when trying to patch.

 

So something like this:

 

Patch(PowerApp,Defaults(PowerApp),{
Title: txtTitle.Text,
LookUp: {Id: drpLookUpColumnListValues.Selected.ID, Value: drpLookUpColumnListValues.Selected.Name}
}
)

 

In the above:

 

PowerApp is the name of the List, that has a LookUp column called LookUp, original I know.

 

Id and Value are the schema it wanted to allow me to add the LookUp value. Where drpLookUpColumnListValues is the name of actually in my case a DropDown but should be similar for Combo and unless you have a lot of LookUp Values, Drop Downs might actually be more efficient.

 

Let me know if you are still struggling after trying the above?

 

 

 

 

WarrenBelz
Super User
Super User

HI @neill_long ,

You might try this

ForAll(
   HubRequests, 
   Patch(
   NEWLDREquipment, 
   Defaults(NEWLDREquipment), 
   {
      StaffName: Name, 
      Email: Email, 
      Department: Department, 
      CourseCode: CourseCode, 
      LecturerResponsible: Lecturer, 
      Title: Location, 
      NumberRequired: NumberRequired, 
      StartDate: StartDate, 
      StartTime: StartTime, 
      EndTime: EndTime, 
      Recurring: Recurring, 
      EndDate: EndDate, 
      HubType: HubTypeSession
      Block: Block, 
      Room: Room, 
      Sessions: 
      ForAll(
         FTSessions,
         {Sessions:Title}
      ),		 
      Notes: Notes, 
      BookingType: Type}
   )
)

 

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.

neill_long
Resolver III
Resolver III

@Anonymous  & @WarrenBelz   unfortunately I am unable to get your suggestions to work.

 

Decided to change the field in the SP List to a Single line of text field and changed the formula to:

 

Sessions: Concat(FTSessions,Title&" , "),

 

It patches and works fine.  The only issue though is if we need to amend the booking and edit the selected sessions, I can't set  the combo box to display the defaultselecteditems as the SP field is a text.  Unless you know a way where i can sort that, i would be nice to have it but it's manageable without

 

thanks

Hi @neill_long ,

The syntax is valid for patching to a multi-value field - I am surprised it did not work for you. I might have the values slightly wrong as I cannot see you model. You can get back the values into a table with 

Split(Sessions,",")

 

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 Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (1,970)