cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mvandelinde
New Member

Trouble Patching a Collection To a SharePoint List

I have an Editable Gallery that displays items from a SharePoint List. Users should be able to change columns like assigned to, start due date, for multiple records in the gallery. I’m following a video posted by Reza Dorrani (https://youtu.be/8I0Pt_8I6k8) which shows exactly what I’m trying to do, but it isn’t working for me.

 

In my App OnStart I have the following: 

ClearCollect(colTaskUpdates,Defaults(CH_ProjectTasks)); Clear(colTaskUpdates); In the Gallery, each editable column has it’s Onchange property set to: Select(ChangesButton) The ChangesButton OnSelect property is set to : If(ThisItem.ID in colTaskUpdates.ID, Update(colTaskUpdates, LookUp(colTaskUpdates, ID = ThisItem.ID),{'Assigned To': AssignedTo.Selected.Value, 'Start Date': StartDate.SelectedDate, 'Due Date': DueDate.SelectedDate, 'Task Status':TaskStatus.Selected.Value, ID:ThisItem.ID}), Collect(colTaskUpdates,{'Assigned To': AssignedTo.Selected.Value, 'Start Date': StartDate.SelectedDate, 'Due Date': DueDate.SelectedDate, 'Task Status':TaskStatus.Selected.Value, ID:ThisItem.ID}))

Confirmed the collection is storing the information that was changed

 

My Save Button’s OnSelect property is set to: Patch(CH_ProjectTasks, colTaskUpdates)

 

This is the error message I’m getting: Invalid argument type (Table). Expecting a Record value instead.

 

I’ve tried this several times, following the video step-by-step but cannot get this to work. Hoping someone might be able to help me understand what I’m doing wrong.

2 REPLIES 2
WarrenBelz
Super User III
Super User III

Hi @mvandelinde ,

Try doing this

If(
   ThisItem.ID in colTaskUpdates.ID, 
   Patch(
      colTaskUpdates, 
      {ID:ThisItem.ID},
      {
         'Assigned To': AssignedTo.Selected.Value, 
         'Start Date': StartDate.SelectedDate, 
         'Due Date': DueDate.SelectedDate, 
         'Task Status':TaskStatus.Selected.Value
      }
   ), 
   Collect(
      colTaskUpdates,
      {
         'Assigned To': AssignedTo.Selected.Value, 
         'Start Date': StartDate.SelectedDate, 
         'Due Date': DueDate.SelectedDate, 
         'Task Status':TaskStatus.Selected.Value, 
         ID:ThisItem.ID
      }
   )
)

 

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.

WarrenBelz
Super User III
Super User III

Hi @mvandelinde ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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 (2,178)