I have a form where a user can Create a new record that will be stored in a SQL table.
I have created a label called 'errorLabel' that displays **User Email already esixts" and the Visible parameter is set to False.
The sql table uses a field called UserEmail as the primary key.
I have added an icon button and I am trying to set the OnSelect function of this button.
When the user clicks the icon button I want to LookUp in the sql table to make sure that the new UserEmail does not exists in the SQL table.
If the record does not exists then Submit the form to the sql table for creation and then ResetForm.
If the UserEmail key value does exists in the sql table then set the Visible parameter of the 'errorLabel" to True.
I am having an error with my syntax... can anyone make a helpful suggestion...
Button Syntax -
If(LookUp('[dbo].[Users]', UserEmail = UserEmail_DataCard.Update, UserEmail), UpdateContext({cVisible: true}) , SubmitForm(EditEmployeeForm));ResetForm(EditEmployeeForm)
I get two error check messages
1. invalid argument type (text) expected Boolean
2. the function'If' has some invalid argument types.
Any help would be appreciated.