Dynamic cloud variables

Hello everyone.
I am trying to make an app right now where I have to create a cloud variable with text stored within another variable. And the first time I set it to something it works. but when I try to call the same variable again it stops working. Here are a few screenshots of my code.
image



Why is this as the name should always be the same right? why does it return null if it should actually return 1,Test,abc? Sorry I can’t put anymore pictures.

The way you’ve set this up is a problem:

image

Let’s say your app variable select has the value “test”. By adding app variable in front of that, Thunkable is looking for a variable called “test” and trying to get its value and use that as the path in Firebase. But that variable called app variable test probably doesn’t exist.

You need to remove the app variable " " block. It should just read set cloud variable app variable select to.

Screenshot 2023-11-03 at 8.40.50 AM

Did that and then I could click it but nothing happened. I used the app variable block to get the content in this case the name of the item stored in the select variable. This should theoretically then make a cloud variable with the name of the item. Also I want to be able to call that variable again later. Even after closing the app. But thank you for your reply.

Can you post a screenshot of the updated blocks? I’m not sure you understood what I wrote and it would be good to double-check what you have before you keep working with cloud variables.

I indeed have double checked the original one and it still worked with the small issue. These are again screenshots of the updated code.


I’ll take your word that it’s working but I’ve rarely seen variables set up that way so that’s why I was skeptical. So the value of app variable select is actually the name of another variable? If so, then you’ve coded it correctly except that it seems you have used the blocks inconsistently… sometimes with app variable in front of that variable and sometimes not.

1 Like

Yes and no. App variable select contains the name of the selected item. What I am trying to achieve is that I want to create a cloud variable with the name of the item, which is stored in app variable select. I then want to be able to save items in it, and when they open the app again or go back and select the same item again that they can see what they have put in that list.

Why aren’t you setting the value of select?

You are setting the value of a variable that has the name of the value held within select at the time of setting the variable

Set app variable

:point_up_2: Isn’t the same as the preconfigured setters that look like :point_down:

Set app variable variableName (no text input)

What do you mean by

? Because I am setting the value of select and it is the name of what the variable is supposed to be later. Thats also why I put it in the Name slot of the set variable block. I want the block to create a cloud variable that is stored on my firebase with the name of the item, which is contained in select. This variable (since it is a cloud variable) should be able to be called later the same way.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.