Get THIS column name

I need get the column name value (in text) for something like:

SELECT(Opciones[Opcion],[Pregunta]=[THIS_COLUMN_NAME])

Is there any way to do it? I want this because the column name is the same as the value i have stored in the column “Pregunta”. I don’t know if there is another way to do it, i’m very new in AppSheet. Thanks in advance

1 11 315
11 REPLIES 11

I’m afraid you can’t read the column name and then use it with your formula. Though it sounds that you trying to use something like…
SELECT(Opciones[Opcion],[Pregunta]=[_THISROW].[ColumnName])

Thanks for the response, Aleksi.
Actually i’m using this: SELECT(Preguntas[Texto],[Pregunta]=“S1-P1”) (where S1-P1 is my column name) and it’s just working fine, but i just wanna know if there is a way to not to hardcode the ColumnName part

Sorry for my English, but thanks for the response

Try with…
SELECT(Preguntas[Texto],[Pregunta]=[_THISROW].[S1-P1])

I see this topic wasn't solved. I ahve the same problem here.

Have you been able to solve it by yourself in the meantime?

There is no way to get the column name using an expression.

Do you have any suggestion to get around this issue?

Thanks for the reply!

BTW, why do you need to get the column name? That's something you should know as the creator and probably you need to do something like that if your tables are not normalized.

Try making a new post explaining exactly what you need

I have a Table A that includes 10 columns of prices.

Then, I have another Table B in which I have 10 virtual columns that extract certain prices from the Table A. For all the 10 virtual columns, the formula is exactly the same, except for one parameter, that coincides with the column's name (from both tables A and B). For example: SELECT(Table A[Column A], ([Column B] = "Price column 1")). For the next 9 virtual columns' formulas, I had to replace "manually" the parameter "Price column 1" to "Price column 2", "Price column 3", etc.

If I could get the virtual column's name, I could just copy past the full formula and simply change the virtual column's name (to match Table A's columns) and get the prices I want faster.

Not sure if there's a turnaround for this.

PS: Thanks for the reply! I'm pretty sure I didn't explained myself well. If you need more details, please ask.

The problem is that I don't see the issue. I mean, if I were working on AppSheet's backend, I wouldn't change the platform in order to make it fit what you need.
The manual config is exactly what you need to do since it's (IMHO) not expected to have that kind of scenario on a normalized database.

I don't want to judge your setup that much but I think that those prices should be on rows instead of columns. It's a common idea that most people drags from GSheets/MSExcel world, Idk why. I guess pivot tables have also pivoted our minds.

Just to amplify the idea
Column names and the amount of columns should not be a dynamic or variable subject, so no need for "get this column name" kind of scenario.
Rows are the ones for that matter, you can grow your database with thousands of rows and each one could be calculated every time you sync to reflect a different result (not that recommended though).

I totally agree with you: we should build tables in rows rather then in columns (Spreadsheets/pivot tables pivoted our minds. Good observation!)

I try to build databases like that most of the times. However, in this case I was having troubles (I didn't push the brain much, I admit).

Let me explain. For user friendliness purposes, my goal is to allow the user to register the 10 prices in one view, in a massive way (10 prices again and again).

I suppose I can do something as:

1. Create a Table A with the 10 products list

2. From that table, create a view to record the prices

3. Create a Table B that inserts batchs of 10 rows at a time

This'd require an extra table but could do the work.

Do you see a better way to do this?

Thanks for the reply!

Rather than describing ways you might solve your problem, it would help us if you describe the problem you're trying to solve. Why would the user be entering batches of prices? Prices of what? Please try to give us an idea what is going on, and please use plain language (as if explaining to your grandmother).

Top Labels in this Space