cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
neill_long
Helper III
Helper 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
HenryARPhillips
Continued Contributor
Continued Contributor

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

HenryARPhillips
Continued Contributor
Continued Contributor

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

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
Helper III
Helper III

@HenryARPhillips  & @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.

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (85,367)