Hi there,
I am having trouble with "patching" existing records of a SharePoint List from Powerapps.
I simply have a button in my app and the OnSelect Property looks like
"Patch(TimeTracker;{User:User().FullName};{CheckedIn:true})".
An entry with the condition "{User:User().FullName}" exists but the app still creates a new entry all the time. Doesnt matter what I am trying.
Maybe someone of you got an idea why? Am I doing something wrong here?
Best Regards
Felix
Solved! Go to Solution.
If you are updating an item with Patch then the second parameter needs to be the record you want to update.
Example:
Patch(TimeTracker; First(Filter(TimeTracker; User = User().FullName)); {CheckedIn:true})
If you are updating an item with Patch then the second parameter needs to be the record you want to update.
Example:
Patch(TimeTracker; First(Filter(TimeTracker; User = User().FullName)); {CheckedIn:true})
Hey,
thanks for the quick response.
I was thinking that "{User:Text(User().FullName)}" ,which is my second statement, determines which is the record I want to update. I chose this option rather than "First(Filter(TimeTracker; User = User().FullName))" because i thought its faster.
But i tried doing it with "First(Filter(TimeTracker; User = User().FullName))" and it works. I could swear i tried that before and nothing happened.. Dont know where my mistake was.
Thanks a lot, its working now 😃
Hi @fher
Patch ( TimeTracker, LookUp( TimeTracker, User = User().FullName), { CheckedIn: true } )
In your condition, you actually push the value for a new entry. You have to search for that certain record you want to update. So first a LookUp that will contain the correct record, and then push your values to it to update.
EDIT: I see someone beat me to it