Hi and thanks in advance I have a option set list that I used to pick cards with different questions. I need help to get it not pick the same question in a run of several cards. I use get an option, questions, all questions, random item. All cards are a button so click on the card to get the next one.
Hi there, @shawnmaguire444… one way you could go is to store the used cards in a custom state list, and then filter that list out of the available cards when the user clicks to get the next card.
Hope this helps.
hey mike thanks for the reply, so i created a new custom state of used questions on button 1 before it said show question 2.
would the value of that be button question 1 used questions: converted to list?
Not really. When the button is clicked, where are you showing the question? If you can give me some more details, I can probably make a quick example for you.
Okay, so each button’s label is a question from the option set, and when each button is clicked, the next button appears with a different, non-duplicated question, right? If that is the case, I probably wouldn’t use buttons, but instead, I might show all of the questions (sorted randomly) in a repeating group that has a text element in it that is styled to look like a button. You could create the experience you described by hiding the text element on page load and putting a condition on the element to show it when a custom state list of numbers includes the current cell’s index. Then, when each “button” is clicked, add a number to the custom state list that is the list’s last number plus 1.
Also, when adding an item to a custom state list, set the value of the custom state to the custom state (literally select the custom state itself) and then use the :plus item operator to add the item to the existing list.
hey mike I’m gonna owe ya several cases of beer. I got text elements in a repeating group to show a random question I just cant figure out the state expressions. This is what I got
What you got is, well, wrong.
No, but seriously, you should consider taking a big step back and working through Bubble’s lessons and courses because without a good understanding of the basics, you are really going to struggle to get up Bubble’s very steep learning curve.
The above being said, here is how to do what I described. I have a custom state at the page (index) level that looks like this.
I have an option set called
OS Questions, and I have a repeating group with a data source that looks like this.
The text element in the repeating group is configured like this.
When the text element is clicked, here is the workflow that sets the custom state.
Finally, you will need to set the custom state’s value to 1 when an action is taken (whatever that is in your app) so that the first question is shown, and my example does that on page load with a workflow that looks like this.
Anyway, that’s what I’ve got… best of luck.
You’ve been a huge help man thank you. The one thing I’m having trouble with is the current cell doesn’t come up. Trying to figure out why for awhile. I put a fixed number of 6 cells in the repeating group should that be different?
Share screenshots of every part of your setup, just like the ones I showed, or send me a link to your editor (privately), and I will take a look at it.
i can send you link probably easiest. Do you just hit share page in the browser header? By email? For info I made a card game and had a 1000 decks made in china where you have 30 theme and 50 questions. each player get a piece of paper that you fold in half 3 times and then unroll so there 8 sections in it then you write an answer to the question at the top and fold over answer then everyone passes page down one. At the end you unravel the page one at a time and read out the answers. It doesnt sound unreal but man some of the answers that come out blow your mind. Everyone ever played it loved it. You laugh the hardest at your answers. I definetly send you a deck for this
Hey Mike how goes? So I learned quite a bit, I created a fully responsive version thats getting wrapped as we speak for the play store. Couldnt have done it without you thank you. We made a little different of the game which is fun you put the names of the people playing then randomly pick one of them to be focus of the theme then all the questions are asked in the first person and you answer as if you were them which allows you to poke a whole bunch of fun at each other. I have it so after a round itll ask whose answer was the funniest and itll only show those inputed but trying to make it so it keeps track of who wins when you decide to stop playing. I can get it to return a number value of who has more wins but cant get it to return to name attached. wondered if you might have any ideas how to do that. Its under blindsided but the page called friendsided.
This topic was automatically closed after 70 days. New replies are no longer allowed.