Allow only 1 selection in dynamic list and proceed

Hi,

For a new project (playground | Bubble Editor) I want users to select 1 item from a dynamic list. The items in this list come from the data type “Questions” and each item has a “Title”. This works as expected.

When the user makes a choice, a custom state (QuestionIsClicked) is added, allowing me to style it (added a border). Unfortunately, I can’t limit the number of choices to 1. So if you click on another one while one already contains the custom state, the custom state should be moved to the last clicked item. How can I solve this?

Additionally, after selecting 1 item, by pressing the submit button, a record should be created in the Data Type “Answer”. In this record, the QuestionTitle should be added (= Title of the selected Question). How do I do this?

I’m very grateful for any help!

Uncheck the box next to custom state of ‘list’ so it is not a list and only a single value.

use the make changes to thing workflow action

Thanks for your help so far. I am unsure what checkbox you mean. The checkbox below is/was already unchecked or do you mean something else?

That is what I meant, which means by default the limit of the number of questions clicked is already set to 1 then.

But then why am I able to select multiple questions from the list if it only allows me to select 1? It should uncheck the previous one the moment I select another one.

For the other part I managed to set the title of the selected question into the title of the Answer (data type). But after numbers of videos I still don’t understand what I am doing wrong by redirecting the user to the page “Memory” that populates the record data I just created (basically a detail page of the record).

Your condition on the question box might not be correctly setup to reference the custom state value.

Hi,

I appreciate your help, but I’m still quite confused. With my knowledge, I’m unable to solve this.

What I am trying to do is set a custom class on each item of the list (= false) and on click set to true. When an other item is clicked, first set all items to false and then set the latest clicked on true.

I guess it should be the following workflow and I am hoping for a step-by-step guidance so that I can better understand how this works.

Anyone? I am stuck for days :frowning:

This topic was automatically closed after 70 days. New replies are no longer allowed.