I have a PATCH command which should be applying a simple math function, to minus 5 from an existing Value - but it is not working. The intent is to LookUp the user's record in a SharePoint List called PROFILES, then minus 5 from the existing Value in Credits for that Record:
Patch(LookUp(PROFILES,User().Email = email),{Credits:LookUp(PROFILES,User().Email = email).Credits - 5});
This is simply not completing the subtraction and I cannot fathom why - any pointers would be greatly appreciated - thanks!
Thank you - sometimes you get too deep in to see rudimentary issues - I see now I forgot to define the Data Source in my PATCH command, as you have indicated. All working now - thanks!
Hi @AdamGill1965, The syntax of patch is as follow:
Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ])
In your code I dont see the Data source. Try this:
Patch(
PROFILES,
LookUp(PROFILES,User().Email = email),
{
Credits: LookUp(PROFILES,User().Email = email).Credits - 5
}
);
-----------------------------------------------------------------------------------------------------------------------------
I hope this helps.
Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍
Thanks,
ANB
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2