Autofill column descriptions from table I ha...

Autofill column descriptions from table

I have a table questionnaire with column names: first_name | last_name | favourite_animal | …

and another table questions with column names: question_id | question_body

with records like first_name | “What is your first name?”

On the form I would like the description to fill with the question body. For this I wanted to refer to the column name, and the do a LOOKUP, but I can’t figure out how to refer to the column name (or solve the issue in another way).

Any ideas?

0 7 342
7 REPLIES 7

LOOKUP(“first_name”,questions,question_id,question_body)

Yes, but now I would like this “first_name” to be derived from the column name

Unfortunately we can’t read the “fixed” column name.

Harry2
New Member

@Pim_Sauter Could you explain why you need to separate the questions and the questionnaire into 2 separate tables. It seems the need to dynamically identify columns based on column names stems from this design choice.

If you want the displayed question to be different from the column name, you can just type the question into the Column Description field of the column. In form views, the column description will be displayed instead of the column name.

@Harry I already have a list of ~150 questions in multiple languages; ready in a table, and wanted to avoid copying them one by one into the description field, if possible. I figured I could reference them by the column name, but unfortunately I cannot then and will have to go for this approach.

Also, I am working with a database, so I cannot have the questions as column names, as they contain spaces

Harry2
New Member

@Pim_Sauter The column description does accept expression, so you can use the expression that @Aleksi_Alkio suggested. However, since it’s not possible to dynamically extract the column name at the moment, you will need to “hard-code” the column name into the expression.

Top Labels in this Space