Open a screen for the first time using TinyDB

So, im making an app for my school, but im using a log in screen where students dont need to type their username or password, the app will autofill for them. My problem is that whenever i open the screen for the first time, it shows an error message (i mean.. thats right i didnt sign in yet) but i wanted to customize that error message.
( Select list item: Attempt to get item number 5 of a list of length 0: () )

This is Screen1
it basically just autofills the Username(txtUsuario) and password(txtSenha) fields

image

???

This will not work, because you need to test the got taglist event...

what do u mean by taglist event? what i wanted to do is:
If u dont have any tags (aka stored data)
then show "sign in!"

GetTags() Return a list of all the tags in the data store. You need to check for an empty List not an empty Text Block. Try using a create empty list Block.

so that would be, if GetTags = create empty list, then show sign in ?

Like this:

The same error still occurred, ( Select list item: Attempt to get item number 5 of a list of length 0: () )

Why do you need a list of 6+ items in TinyDB,
and have you run out of ideas for tag names for whatever you were storing
in those list items?

They deserve their own tag names and values.

i need a list to store:
Math class, english, etc...
second, im just a newbie trying to make an app, names for me doesnt rly matter lol.

Try it:

The problem is that your list is empty. When the list is empty there are no entries, so its length is 0. You are trying to get entry 5 and 6 from the empty list.

1 Like

im so annoyed, even with u guys help it stills shows the same error ._.

f4b53e9abc573f37c6bc237d7f27fa678d838eaa_2_690x335

Please explain global rotulo to us.

Try it:

im going to share my project with you guys,just let me translate some labels. Give me a minute

here is my project, if yall got any questions about translation, yall can ask me
Escolabr.aia (1.3 MB)

blocks

Still need that explanation about global rotulo.

i dont know what is it. I made that project 2 years ago and only today im giving it more attention, since covid is a thing.

The blocks you showed are on Screen1. The App always starts on Screen1. When the app starts, there is no data in the variable "rotulo", so your list is empty.

Try it.

A message will appear, but there will be no error.