Help with creating dropdows in form view

Help with creating dropdows in form view

  
Bare with me as I am very new to developing.

I am creating a quality assessment tool, this is a series of questions all with the same set of answers.  Based on the combination of answers it gives a set of outcomes.

The answers to the questions are all Yes, No, Almost, N/A.  There are 150 questions in total relating to 8 different areas.

I want the questions to be answered with a listbox showing those answers but I thought that the best way to store this data is for each answer to inset an integer, this will hopefully make manipulating the data easier in the long run.  How would I do this?  

I have tried creating a static entity and then relating it to the data table, but can't figure out how to get the listbox working i.e. showing the answers in the static entity but inserting an integer into the other table.  

Thanks for any help!
Josh
Hi Joshua

The way you trying to do looks the best one, where are you getting the problems?
You just need to set the entity and combo like this (almost everyting is already setted like that by default):



Then for your use case you need to put it inside some list records to have it for each question and set the variable to the list record record.
That variable is of type "Answers Identifier", that in the database will actually be a integer as specified in the static entity.


Btw, I sugest not using Auto-Numbers as the identifier of the static entity ..just makes things less complicated in the long run.

Regards,
João Rosado
"Then for your use case you need to put it inside some list records to have it for each question and set the variable to the list record record.
That variable is of type "Answers Identifier", that in the database will actually be a integer as specified in the static entity."

You lost me with this a bit.  

I have put in a combo box, the Source Entity is "Answers" it is asking me for a variable, but gives a very limited choice (see below).  And where do I put in the Entity Attribute which is going to store the value?

  
Hi Joshua

Note: Had some naming problems writting this because I had named the static entity Answers ..lets call it "AnswerOption".


Since you have many questions, I assume you got the questions stored in some table. Lets say, for my example that its an entity with Id (Integer), Question (Text), Area (Area Identifier). Entity called "Question".

This is a way to do it. There are multiple ways to achieve what you need ..think this is the easyer for this case.

If you create an entity to store the answer results. For example an entity with Id (Integer auto-number), QuestionId (Question Identifier), AnswerId (AnswerOption Identifier). Lets say you call it "Answer".

On your screen preparation create an Advanced Query. Add as outputs both "Question" and "Answer" entities.
The query should be something like:
"SELECT {Question}.*, 0, {Question}.[Id], 0
 FROM {Question}"

Then add a List Records to your screen, drag the Question entity to it.
Then drag a combo box, set the Source Entity as "AnswerOption" and the variable something like "ListRecords1.List.Current.Answer.AnswerId"
On the submit just do a for each over the ListRecords1.List with a CreateAnswer action (with "ListRecords1.List.Current.Answer" as input).


On my query I used 0 as default AnswerOption. If it matches a Id of your AnswerOption if will be the option selected by default. Don't use 0 as the N/A id if you just dont want it to be empty by default.
Also you can filter by area, or make some more complex query if you want.

Wrote this by head ..so hope didn't mess up anything.

Regards,
João Rosado