Using the text on a TextBox to call a variable. Is it possible?

Hi guys,

In my application I have several variables that I would like to present in a label, according to the text of another label, which is randomly changed during operation.

As there are many, I would like to build the name of this variable from the text presented, instead of using a huge sequence of If statements.

See this example to illustrate:

Capturar

Can any of my colleagues help me?

Thanks in advance.

Post all relevant blocks (and the aia).

https://community.appinventor.mit.edu/t/how-to-ask-a-question-open-new-topic

Thanks for the quick response @Anke,

I apologize if I was not clear enough in my presentation.

Here are the blocks relevant to my problem and my complete project file for your study.

Layout_2.aia (934.1 KB)

just use the text getter property of the corresponding labels
for example

unknown

Taifun

Thank you @Taifun,

Ok, but can you show me how to apply the text returned in the get.variable block, when Lable1.Text is one of the 3 available variables names (Data1, Data2 or Data3), as my example?

Capturar1

The get Label1.Text will always return the text of that label, no matter how you set that text previously

Taifun

I recommend Chapters 19 and 22 from
http://www.appinventor.org/book2

Also see the introductory articles at

concerning table lookup.

Thank you so much @ABG ,

I will carefully study the documents you suggested. I'm sure I'll find the solution there.