cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HFG
Advocate II
Advocate II

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

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

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

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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (18,491)