@Anonymous
Inside the optional third argument of the Patch itself. And this whole Patch goes in the OnSelect of your "Submit" Button:
Patch( DataSource, BaseRecord, With({_myRecord : LookUp(YourNameColumn = User().FullName}),If(!IsBlank(_myRecord),_myRecord, Blank())))
The above essentially makes the Patch conditional between two versions. If the LookUp record exists, it will use it as the record to Patch. Otherwise, it will not use any record to Patch, which calls the version of Patch which creates a new Record.
Check if it helps.
----------------------------------------------------------------------------------------
EDIT: While the above exactly as it was had been accepted as solution, in case someone that comes across this has trouble when trying the above, it is possible you might need to do it more like the following instead.
I did not test either version, and both versions are for initial guidance only, here is the version that I believe might be more correct though:
From my solution Font size and weight custom settings
You can do this kind of create new item or edit existing item using e.g. Patch function.
Patch( DataSource, BaseRecord, ChangeRecord1)
In the above, if BaseRecord is Defaults(), the Patch will create a new item instead. If BaseRecord is an existing Record instead, the Patch will instead modify that existing record. So same formula above can do both things based on what the value of BaseRecord above is.
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch#modify-or-crea...
Modify or create a record in a data source
Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ])
- DataSource – Required. The data source that contains the record that you want to modify or will contain the record that you want to create.
- BaseRecord – Required. The record to modify or create. If the record came from a data source, the record is found and modified. If the result of Defaults is used, a record is created.
- ChangeRecord(s) – Required. One or more records that contain properties to modify in the BaseRecord. Change records are processed in order from the beginning of the argument list to the end, with later property values overriding earlier ones.
-----------------------
In other words, if the solution as I have it didn't work, then:
1. Actually the solution I gave it might be pretty close. The 3rd argument might need to be almost duplicated again for the 2nd argument as a conditional too, except this time using Defaults() instead of Blank() for the case of a record not existing, and making sure to be using the original record as is without modification for the record to modify.
2. Also, the 3rd argument as originally given, might need to be slightly adjusted to have the actual changed record you want to perform (not the existing record - because the existing record belongs in the 2nd argument). The use of Blank() as originally given, in the case of the record not existing - this might actually be fine.
3. Putting an outer With at the very beginning of the Formula may help reduce duplication of statements in the formula that might occur if doing the above.