Fórum Fórum

Vissza

Using Variables to refer to objects

Váltás
Using Variables to refer to objects
Válasz
2021.08.02. 23:39
I must be way overthinking this. I have 4 text boxes Box1, Box2, etc, Box1 and Box2 have text, Box3 and Box4 are empty. Created a varible that increments everytime a button is clicked, joined that with "Box", and asigned it to a new variable, thus the new variable, becomes Box1, Box2, etc every time the button is clicked. Look up the "text" inside Box1, if it is blank change the button text to "success", press the button again it will then check "Box2", if it is blank...

I can't figure out how to use a variable to refer to an object? The value on the left bottom works when dropped into the if statment, the value on the right doesn't when used.
0 (0 Szavazatok)

RE: Using Variables to refer to objects
Válasz
2021.08.03. 1:16 válaszként erre: Ry Landry.
Hello Ry,
Interesting idea. The issue you're running into is that you cannot refer to objects by their names. The names are a piece of a metadata, but they are not unique and they are not the way SmartBuilder references objects - objects' true names (references) are hidden.

However, you can easily tag your objects, which makes them a list. And then you can say "get item 4 from the list called 'box' ", and reference objects that way.

Here's a video - https://www.screencast.com/t/MiOomiGESg

Let us know if you have any more questions around this! Tag Lists and Lists in general are powerful tools.

- Nav
0 (0 Szavazatok)

RE: Using Variables to refer to objects
Válasz
2021.08.03. 2:03 válaszként erre: Navdeep Dhillon.
I will play with around with this, I think from watching your video I can accomplish what I need to do (way out of Smartbuider normal scope emoticon I know). This gives me a better understanding of how to work with things. Thanks again Nav! 
0 (0 Szavazatok)