Hi @sienna28 ,
The patch function is different if one is editing a record rather than adding a new one with respect to the second argument of the function. In the case of adding a new record it is
Patch( Customers, Defaults( Customer ), { Name: “Contoso” } ).
This syntax creates a new record. In the case of patching an existing record, instead of Defaults(), you specify the record being patched ie.
Patch( Customers, Lookup( Customers, Name = "Contoso" ) , { Phone: “1-212-555-1234” } ).
To determine which one to use, test if the record exists and then which syntax to employ, you can use an If() function combined with an IsBlank(). Something like:
If(IsBlank(Lookup(Customers,Name="Contoso"),Patch( Customers, Defaults( Customer ), { Name: “Contoso” } ),Patch( Customers, Lookup( Customers, Name = "Contoso" ) , { Phone: “1-212-555-1234” } ))