Select a different data column depending on a variable

Hello!
I got a simple question for you (very complex for me).
This is the scenario:
I have a variable that can be modified with a button, the possible values of the variable are: A, B, C, D, E, etc…
The database has 8 categories in columns named Cat A, Cat B, Cat C, Cat D, etc… and one row per user.
Depending on the value of the variable, I would like to display the contents stored in the different columns for the specified user.
For example, if the variable is A, I would like to display the contents of column Cat A, if the value is B, the contents of Cat B, etc…
708ddd926dc05a939c9b3ae0def0531e6fe3d3d7

I tried using conditionals and making the text not visible when the variable is not selected. However, considering that so far I have 8 columns and inside each field I can put 10+ values, it gets very very long and not really efficient if I would like to add another category.

Any ideas or how would you approach this?

Unfortunately, you can’t select a database/column dynamically. So you will have to do it manually in your App.

If variable = A then bring data from Cat A;
If variable = B then bring data from Cat B;

What you can do to solve this issue and allow you to grow is to store the categories in a separated database.

User | Category | Value

So an example would be something like:

John | A | A0101, A0102, A0103…

Doing this, when John select the category A, you can do a Search inside the Category database contraining this user, and use the selected category.

Make sense?

Thanks!
I will try the solution you mentioned.