cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Patch: Invalid argument type (Table). Expecting a record value.

Hi, 

 

I'm trying to Patch a collection OnChange of a dropdown, but I am getting the invalid argument error.

My collection has a field called "IsSelected" which is set to true when the item is selected in the gallery. This allows me to have multiple items selected at the same time. These are the lines of the collection which I need to update.  

My formula is: 

Patch(
     colTables
        ,Filter(
            colTables
               ,LineSelected=true)
                ,{IsDirty: true
                   , ID_Technologies: DdTechnologyDetails_Tables.Selected.Id_Technologies}
);

Can anyone enlighten me on where the problem is?

 

Thanks in advance! 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Patch: Invalid argument type (Table). Expecting a record value.

Patch only works with datasources and new records in collections.  You can't use it with Tables or to update existing records in collections.  I think what you are looking for is updateIf.  Is colTables a table, a collection, or a datasource?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User III
Dual Super User III

Re: Patch: Invalid argument type (Table). Expecting a record value.

Patch only works with datasources and new records in collections.  You can't use it with Tables or to update existing records in collections.  I think what you are looking for is updateIf.  Is colTables a table, a collection, or a datasource?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Advocate I
Advocate I

Re: Patch: Invalid argument type (Table). Expecting a record value.

Hi, 

 

Thanks for your speedy and very helpful reply, that seems to have sorted it! 

 

UpdateIf(
colTables,
LineSelected=true
,{IsDirty: true, ID_Technology:DdTechnologyDetails_Tables.Selected.Id_Technologies}
)

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,036)