I am new to bubble and could use some help as I feel I have fallen at the first hurdle.
I have a sign up page for my app.
When a user clicks the sign up button I have the following work flow:
Create a company (with an “only if” constraint doing a count of the company name and whether it exists in the db already). I set the count to be “= 0” and this works fine so that duplicate companies of the same name cant be added via the sign up form.
I want to then sign the user up and create a user record, again only if company does not already exist. I cant use the same count of “=0” as the company will exist (created in step 1), so assume I would at this point have to change the constraint on the sign up action to do a check of company names and if “=1” then create the user.
The problem I then have is that assuming the same company filled out the sign up form again, although the company would not get created, if they entered the same, First Name, Last Name, Email, Password - a second user would get created associated to the same company, or even if they put different First Name, Last Name, Email, Password - the flow would still create a user.
What I want is to stop additional users being added via the sign up flow where company already exists but I cant seem to express the properly in my workflow.
Is there a way in which I can add a further condition anywhere in the flow that would stop another user being added? Or am I looking at this the wrong way?
I am not sure how to send a DM!! I cant find anything on how to do this so if I have just posted my app for everyone to see let me know and I will delete
So thanks to @tunacardak the flow now works as expected.
First of all I had not set the conditions correctly and they needed to be moved up a level to the button element level.
So when the sign up button is clicked it performs the search for the company name based on the input field of Company Name’s input field on the sign up form.
Then if the company name “=0” it would proceed to create the company details in the DB.
Again this will then only move on to step 2 (create a user) IF the company does not exist in the DB. The conditions for “Only when” were removed at the create company level and create user level (see my original screenshots).
I have re tested the flow this morning with these changes applied and the process now works as expected.
Very happy as I had been scratching my head with this issue for some hours!!