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

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

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.
2 REPLIES 2
Highlighted
Super User
Super User

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.
HFG
Level: Powered On

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_TechnologySmiley Very HappydTechnologyDetails_Tables.Selected.Id_Technologies}
)

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 216 members 4,666 guests
Please welcome our newest community members: