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

View solution in original post

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

View solution in original post

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_Technology:DdTechnologyDetails_Tables.Selected.Id_Technologies}
)

Helpful resources

Announcements
thirdimage

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 102 members 5,554 guests
Please welcome our newest community members: