Data type of data types

0
Dear Mendix community, I currently want to create an app that asks its user in a kind of questionnaire to provide only relevant information, based on the questions. To keep the app maintainable, I want to enable admin users to define their own questions. A question in itself contains of several elements A title An input field type (e. g. a date, a long text, a short text) An info button that pops up additional descriptions provided by the admin for the user, so the user understands the background of the question A callback button  A “go to next step button”   I am struggling currently with #2. How can I set up the admin “create question page” (so to say) in a way, that the admin can choose e. g. from the following data types: short text (single line) long text (multi line) date radio buttons (yes / no)   The reason I am approaching it this way is that I want to make this app available to a global organization and each region in this organization might have different types of questions. Let’s take a sales process for an example: in the US a sales rep needs an additional approval for a pre sales investment so the admin would add an additional question like “Is the pre sales budget already approved? YES / NO” in Europe each sales rep has its own presales budget and manages it themselves, so they don’t need this question   Thank you in advance, any hint, which way to go would be highly appreciated!
asked
1 answers
0

If I understand your use case correctly, you could simply make something like this:

Admins could create a question and add an answertype (the types you mentioned, a simple enum). On the pages where users can answer the question, you create a new answer object and show the correct fields based on the answertype of the question. Alternatively, you could choose to use specializations of “answer” for each answer type. 

answered