How do you tell CloudDB if the username or password is incorrect/ not in the database

How do you tell CloudDB if the username or password is incorrect/ not in the database?
This is what I have so far. Screenshot 2021-04-10 12.35.34 AM

Thanks In Advance!

And no, this is not all that I have on the app. lol

For a login system you should also have an register system. For a registration system you can use this block.
20210410_121029

  • First it will check the username already exists or not.
  • If already exists then it will show a message.
  • If not it will create a tag named the username and value as password.

And for the Login System you can use this blocks.

  • First it will check if the username exists or not.
  • If it is not existing then it will show a message.
  • If exists, then it will check if the password is correct or not.
  • If correct will show a message that "Login Successful".
  • If not it will also show a message.

Is it ok?

4 Likes

Added to Login FAQ

1 Like

Advice on how to do it on the same screen? My login and register is on the same screen.

Use vertical arrangements as virtual screens, setting their visibility on and off to emulate real screens. organise your blocks in "screen" columns to help you keep track.

Read this for more help:

Use different screens wisely

If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while...      
The recommended method of switching screens in App Inventor
(Thanks Taifun)
 
Also see demo: multiscreen.aia
 

See also here for some ideas about using virtual screen for register/login:

But how do you tell the app that if it is incorrect it doesn't let it go to home?

Explain in more detail what you mean, or what you are trying to achieve....

Oh Figured out that question, but if both the username and password is wrong do both alerts come in together? Or can only one be notified.

Follow the logic in the blocks

  • if the username does not exist, then you will get the username notification (only)
  • if the username does exist, then the password is checked.
  • if the password does not exist (is incorrect), then you get the password notifier (only)

There is no point in displaying the password notifier if the username does not exist :wink: