Firebase getTagList from a Dict

Hello there!

I'm back again after some changes that may make things clear in my blocks.
I really agree that store tags with numbers didn't seem to work well, so I changed the way all clients were stored to a dict. This way we can get the correct tags. I need a little help doing it using Firebase Govalue and GetTag. How can I store all the tags called nomecli inside a listpicker? Just don't give attention to the block with that red square, that was just a failed experiment. Inside clientes I want to get all tags nomecli and display them into a list. I know I asked it for a thousand million times, but I know I still got a lot to learn with MIT.

firebaseia

One way of doing this:

1 Like

Which do you want?

  • the names of the clients of just one user, or
  • the names of all clients of all users?

The rules are read true and write true

the names of the clients of just one user. Yago in this case is the user and joaquim is his client.

Hi Tim! Can I build the web component like this?

Did you try it ? What happens ?
Did you set the indexon in the firebase rules for nomecli?
Why do you set ?auth="token" if your rules are read and write true ?

I tried it and it's still retrieving the entire data. The rules are "open" just for test, the final version of the app won't be open. I'm getting a message error that says the elements can't receive "cpfcli:08222132112", "nomecli:Joaquim da Silva", "all clients data". Can I upload my iai project so you can take a look?

Planekit_Planefacil_teste_1.aia (2.5 MB)

Will the tag/node of the client always equal the nomecli?

1 Like

What rules will you be applying for authenticated users ?

1 Like

No, I would like to change it according to the search filter (spinner). If the user select spinner index 2 (nome), it should return all nomecli from database in a listpicker, if the user select index 3 (cpf/document number) it should return all cpfcli from database in a listpicker. So I would need to change it according to the user's choice. I think there are just 4 different kinds of variables at the spinner.

when I hit the final version of the app this will be the rules:

{
  "rules": {
        ".read": "auth != null",
        ".write": "auth != null"
   }
}

meaning that all authenticated users can read and write all of the data ?

1 Like

I would like to make it readable and writable just for authenticated users

But now I have a doubt: Let's suppose that you are user 1 and I am user 2. If the rules are null, could you read and write over my clients?

You possibly want these rules:

Read All, but Write only to a User's Area
Here, we allow anyone to read data, but only authenticated content owners can make changes to their data. You will see here that an additional level of "uid" has been added. This uses the uid or localId or the user (you see this on the Authentication page). When adding data this "uid" has to be included in the "path".

  "rules": {
    "<ProjectBucket>": {
      "$uid": {
        ".read": "auth.uid != null",
        ".write": "auth.uid == $uid"
      }
    }
  }

1 Like

I think it will fit well! Changing the rules to this, how can we set the blocks? Making the spinner's choice to get the tags we want. :thinking:

Hi TIM! I made part of what was proposed me to build. The Filter using the spinner is working well, but I have 2 questions, I hope you can help me, here we go:

1 - When I hit the button to read all the values of the tags "nomecli" the listpicker only get the last client stored in database, I would like to get all values from the tags "nomecli". Am I missing somthing in my blocks?

2 - When I close the app and open it again, if we press the read data button from the spinner the listpicker stands empty, is this about the rules I'm using, read and write = true? It only works well right after we register a client.

  1. You are only returning one value, not saving each value to list
  2. Probably you need to login?

See you are still fighting with brackets.... :stuck_out_tongue_closed_eyes:

Oh yeah! I need to save them into a list! Not only return from the DB. About the login, I think it's working, because everytime I log in, when authenticated, the user ID Token and Email is shown at the top window. So I think it's working good.

Is there a way to return a single variable using the JOIN block with the web gotText?