cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
neill_long
Level: Powered On

Patch error

I'm getting an error on my patch and can't figure out how to fix it:

 

Here is what i have:

 

ForAll(LearningHubRequest, Patch(NEWLDRLearningHub, Defaults(NEWLDRLearningHub), {Title: CourseCode, Lecturer: Lecturer, Location: Location, NumberStudents: Number, StartDate: StartDate, StartTime: StartTime, EndTime: EndTime, Recurring: Recurring, EndDate: EndDate, TypeSession: Type, Room: Room, Sessions: Sessions, Notes: Notes, MasterID: Form3.LastSubmit.ID})); Clear(LearningHubRequest); Navigate(Confirmation,ScreenTransition.Cover)

 

It is patching to a sharepoint list.  The error is with the sessions part.  The sessions is a table consisting of multiple items selected from a dropdown list.  the field it should be patching to in the sharepoint list is a choice field.

 

The errors i'm seeing are:

 

'Invalid argument type.  Expecting a table value, but of a different schema.'

 

'Your formula is missing a column 'Value' with a type of type 'Text'

 

Can anyone help and let me know what i have done wrong?

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
neill_long
Level: Powered On

Re: Patch error

@TimRohr there may be a better solution than what i did, but on the form, the combo box that listed all the sessions gathered these items from another SPO list. 

 

On the Add Request button, when it collects the items selected in the combo box, it collected the sessions.selecteditems.title

 

This worked fine up until i got to the patch and it didn't like the title part of the formula.

 

I changed the items property of the combo box and manually entered the values and changed the collect formula to show sesions.selecteditems.value

View solution in original post

5 REPLIES 5
TimRohr
Level 10

Re: Patch error

I might be stating the obvious, but the problem could be the structure of the "Sessions" table versus what the "Sessions" choice field is expecting. Without replicating your setup, I think you need a one-column table.

 

Can you post the structure of the Sessions table prior to attempting the Patch command?

neill_long
Level: Powered On

Re: Patch error

Hi @TimRohr,  I'll try and post as much detail as i can, here i have the form that users complete:

Capture.PNG

The Add Request button send this to a collection:

Collect(LearningHubRequest, {CourseCode: CourseCode.Text, Lecturer: LecturerRespon.Text, Location: Location_Drop.Selected.Value, Number: Value(NumStudents.Text), StartDate: StartDate_Hub.SelectedDate, StartTime: StartHub_Drop.Selected.Value, EndTime: EndHub_Drop.Selected.Value, Recurring: RecurringHub_Drop.Selected.Value, EndDate: EndDate_Hub.SelectedDate, Type: TypeSession_Drop.Selected.Value, Room: RoomHub.Text, Sessions: FTSessions_Combo.SelectedItems.Title, Notes: NotesHub.Text, Click: false}); Navigate(LearningHubAnyMore,ScreenTransition.Cover)

The collection looks like this:

collection.PNG

The table within the collection:

table within collection.PNG

And finally the SharePoint List:

Sessions.PNG

Hope that all makes sense

neill_long
Level: Powered On

Re: Patch error

@TimRohr 

 

I think i have managed to fix it, thanks for your response.

 

Alistair

TimRohr
Level 10

Re: Patch error

That's great, @neill_long!

 

Can you post your solution so others can benefit?

 

Did it have anything to do with the amount of data the Sessions field (in the SharePoint list) would accept?

neill_long
Level: Powered On

Re: Patch error

@TimRohr there may be a better solution than what i did, but on the form, the combo box that listed all the sessions gathered these items from another SPO list. 

 

On the Add Request button, when it collects the items selected in the combo box, it collected the sessions.selecteditems.title

 

This worked fine up until i got to the patch and it didn't like the title part of the formula.

 

I changed the items property of the combo box and manually entered the values and changed the collect formula to show sesions.selecteditems.value

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,949)