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

Problem using the Patch function

Hey,

Im having a problem with the patch function in the following OnChange field of a text input field.

 

Set(Ident;Value(TextInput1.Text))&&Set(Beschreibung;LookUp('ProGlove Game';ID=Ident;Beschreibung))&&Set(Titel;LookUp('ProGlove Game';ID=Ident;Titel))&&Set(Punkte;Punkte+LookUp('ProGlove Game';ID=Ident;Punkte))&&

Patch('ProGlove Game';Filter('ProGlove Game';ID=Ident);{Hit:true})

&&Reset(TextInput1)

 

Im trying to change the "Hit" flag of a sharepoint item. Its ID I type into the text input field.

The red marked function is giving me invalid argument errors.

Does anybody have an idea?

5 REPLIES 5
Highlighted
Helper I
Helper I

Re: Problem using the Patch function

Somehow it works when I put the function in a button and then let the text input field click it. Though then I loose focus of that field and cant continue writing. Does anybody have an idea how to restructure?

Highlighted
Dual Super User III
Dual Super User III

Re: Problem using the Patch function

Patch() works on a single record at a time.  So either switch out your Filter() for a Lookup or add First() to the outside of the Filter.  That will return one record instead of a collection of records. The collection is why you are getting the invald arguments.



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

Re: Problem using the Patch function

The First doesnt do anything. We have already tried that

Highlighted
Dual Super User III
Dual Super User III

Re: Problem using the Patch function

Then I would try Lookup.  The point is Patch won't work on a collection of records.  You need to pass it a specific record as the second parameter.  Filter will supply a collection of records even if its only a collection of one.



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

Re: Problem using the Patch function

We tried Lookup aswell, though like I mentioned above, the code works in a button but not in my text input field. I can trigger that button from that text input field but cant get the cursor back in it afterwards

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,869)