Selecting a button as an option from small survey

I am trying to develop an Outsystem PWA application with Multiple choices question and answer. Few details i would like to high light here for my application.
It has few questions and questions has multiple choices, these choices are buttons of button group.

I have list vaiable which holds the value for the buttonitem but when i change a single question all the questions get chage. Is there a outsystem way to get this resolved


Satish Kumar wrote:

I am trying to develop an Outsystem PWA application with Multiple choices question and answer. Few details i would like to high light here for my application.
It has few questions and questions has multiple choices, these choices are buttons of button group.

I have list vaiable which holds the value for the buttonitem but when i change a single question all the questions get chage. Is there a outsystem way to get this resolved


Hi Satish, Check if the variables assigned to the buttons aren't the same for all buttons.

Can you upload the oml?


I agree with Carlos.

You are using GetSurveys.Current. Try using Surveys.Current.


Carlos Lessa wrote:

Satish Kumar wrote:

I am trying to develop an Outsystem PWA application with Multiple choices question and answer. Few details i would like to high light here for my application.
It has few questions and questions has multiple choices, these choices are buttons of button group.

I have list vaiable which holds the value for the buttonitem but when i change a single question all the questions get chage. Is there a outsystem way to get this resolved


Hi Satish, Check if the variables assigned to the buttons aren't the same for all buttons.

Can you upload the oml?


Yes i believe so but is there a way to make it dynamic like we usually do in javascriptt with index, i am looking more of a outsystems solutions here.


Satish Kumar wrote:

Carlos Lessa wrote:

Satish Kumar wrote:

I am trying to develop an Outsystem PWA application with Multiple choices question and answer. Few details i would like to high light here for my application.
It has few questions and questions has multiple choices, these choices are buttons of button group.

I have list vaiable which holds the value for the buttonitem but when i change a single question all the questions get chage. Is there a outsystem way to get this resolved


Hi Satish, Check if the variables assigned to the buttons aren't the same for all buttons.

Can you upload the oml?


Yes i believe so but is there a way to make it dynamic like we usually do in javascriptt with index, i am looking more of a outsystems solutions here.


Dynamic, maybe with JS, but if you will have this done just once and will not add items dynamically, just open and assign one by one.


Carlos Lessa wrote:

Satish Kumar wrote:

Carlos Lessa wrote:

Satish Kumar wrote:

I am trying to develop an Outsystem PWA application with Multiple choices question and answer. Few details i would like to high light here for my application.
It has few questions and questions has multiple choices, these choices are buttons of button group.

I have list vaiable which holds the value for the buttonitem but when i change a single question all the questions get chage. Is there a outsystem way to get this resolved


Hi Satish, Check if the variables assigned to the buttons aren't the same for all buttons.

Can you upload the oml?


Yes i believe so but is there a way to make it dynamic like we usually do in javascriptt with index, i am looking more of a outsystems solutions here.


Dynamic, maybe with JS, but if you will have this done just once and will not add items dynamically, just open and assign one by one.


I kind of need to something like dynamic quetionnaires only.


Nuno Reis wrote:

I agree with Carlos.

You are using GetSurveys.Current. Try using Surveys.Current.


Actually i am doing as you mentioned if you can check the images attached


Satish Kumar wrote:

Carlos Lessa wrote:

Satish Kumar wrote:

Carlos Lessa wrote:

Satish Kumar wrote:

I am trying to develop an Outsystem PWA application with Multiple choices question and answer. Few details i would like to high light here for my application.
It has few questions and questions has multiple choices, these choices are buttons of button group.

I have list vaiable which holds the value for the buttonitem but when i change a single question all the questions get chage. Is there a outsystem way to get this resolved


Hi Satish, Check if the variables assigned to the buttons aren't the same for all buttons.

Can you upload the oml?


Yes i believe so but is there a way to make it dynamic like we usually do in javascriptt with index, i am looking more of a outsystems solutions here.


Dynamic, maybe with JS, but if you will have this done just once and will not add items dynamically, just open and assign one by one.


I kind of need to something like dynamic quetionnaires only.


Attaching the .oml file here 


Solution

Sorry. my explanation was based on my assumptions.

Your problem is that you are doing Current to Surveys that is not a list in use. Therefore CurrentRowNumber (not that it exists in Reactive, but the equivalent) is always 0. All buttons read from the same position.

What you can do is add a new attribute answer to your questions query with value "" (so it is set as Text like your options).

You use that field in the button group.

And on save you are looping both question and answer simultaneously. I think this is easier.


Solution

Nuno Reis wrote:

Sorry. my explanation was based on my assumptions.

Your problem is that you are doing Current to Surveys that is not a list in use. Therefore CurrentRowNumber (not that it exists in Reactive, but the equivalent) is always 0. All buttons read from the same position.

What you can do is add a new attribute answer to your questions query with value "" (so it is set as Text like your options).

You use that field in the button group.

And on save you are looping both question and answer simultaneously. I think this is easier.


Yeah that helped for what i was trying, thank you.


Nuno Reis wrote:

Sorry. my explanation was based on my assumptions.

Your problem is that you are doing Current to Surveys that is not a list in use. Therefore CurrentRowNumber (not that it exists in Reactive, but the equivalent) is always 0. All buttons read from the same position.

What you can do is add a new attribute answer to your questions query with value "" (so it is set as Text like your options).

You use that field in the button group.

And on save you are looping both question and answer simultaneously. I think this is easier.


How can i get the item values like - Question, and the answer on the click of yes and no for details page.


Hello Satish.

The oml and print explain the user interaction scenario. You still need to do a Save action.

The DetailsPage you mention will read the answers table? That isn't covered here.

Nuno Reis wrote:

Hello Satish.

The oml and print explain the user interaction scenario. You still need to do a Save action.

The DetailsPage you mention will read the answers table? That isn't covered here.

Hello, Nuno, Thank you.

You saved lot of struggle here. 

One more thing i want to auto select/checked the button(either Yes or No or N/A) from the above button group.

As per our above communication i did add an column with empty value and it works but with that i don't get an variable in but an expression attached screen


Hello Satish.

Not sure if I understood.

The "" you give to the calculated attribute, is the default value. if you pass it "Yes", "No", or "N/A" (I mean the ids of the options, but I don't know them) that will be it.

You can use a variable but again, if you give the same variable to all, they will have the same value at the start (it can be changed by the user).

What you can have is on the questions table a "default answer" attribute,