If(IsBlank(LookUpEmail), Patch(DataSourceName, LookUp(DataSourceName, 'Customer Email'=User().Email), FormControlName.Updates), Patch(DataSourceName, Defaults(DataSourceName), FormControlName.Updates))
In the above, I am trying to create an If statement so that if the user email exists already in the underlying data, the record is updated, if not, it creates a new record. This is typed in the "On Select" for a save button to save the information on a form control.
It updates an existing record! But it's not creating a new record if there is no existing email in my data source with the IF statement. The different patch functions for updating an existing record or creating a new record both works separately, but not together in the IF statement. I have no errors in my code. Again, it is only updating an existing record when I do the IF statement, but the Patch functions both work separately outside of the IF statement.
Any insight on what I am doing incorrectly would be appreciated.