The first problem concerns the validate data step in the API registration.
I set up the check to check if a user with the email already exists in the database but I can’t intercept the error to show a notification in the form’s dynamic events.
The second question is this, I have to write the letter P or C in the roles table based on the value of a checkbox.
Can I pass this variable from the form to the API or do I do it through a particular step directly from the API?
Last question, the value of the checkbox (Switch control) present in the form is always inserted NULL in the SQL database (fields of type BIT)
Thanks for the replies Ben, regarding point 1, do I have to indicate the name of the form field in the Linked Field space to make the user see the error in the form?
In my registration procedure, if a user enters a fake email and the last step fails, the workflow goes into error but in reality he has already entered the user’s data in the database.
Is there a better logic to construct this flow? Or can I enter sending the email as the first step and handle a custom error?
By fake email, are you referring to an invalid email address? To stop a new user from entering an invalid email, you can add Validation Rule E-mail on the email form input. This validation rule on the form will check whether a valid email address has been entered and if not, the form will not be submitted until a valid email address has been provided by the user.
If the last step Send Email is failing due to an invalid email address, then that won’t be the case once a valid email address has been provided.
Another logic could be:
when a user has been successfully registered, save the basic required information such as name, email address, password etc.
send an email to the registered user with a link to activate the account
when user has activated the account, then other steps such as creating folders and copying file can be performed
if an account is not activated for a certain number of days, you can either send a reminder and/or delete the account, depending on your business rules.