Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Need help for nesting drop-down prompts

1512437343

Edited 1512437402
Yui V.
Pro
Sheet Author
Hello, I'm currently coding a character sheet and have met a problem. What I'm trying to do is to nest a drop-down query inside of another drop-down query, so that it would produce a tree of options(Select one of three options then have to select one af two more options...). This is specifically needed for selecting predefined in-roll formulas(so no player typing any value here, just selecting things). I can't use a simple ?{query} + ?{query} instead of nesting the second in the first, because some of the primary options don't lead to secondary options and I want to limit the number of queries to a minimum for each option string, to keep them as unintrusive as I can. I know how to nest normal queries inside of other normal or drop-down queries, replacing ',' '}' and '|' by their html entities but what I want is to nest another drop-down prompt in my drop-down prompt, in order not to have dozens of options in one query(I also try to keep the number of separate roll buttons to a minimum, that's why I need one single central query). So my question is simple: Is it possible to nest a drop-down query inside another drop-down query? And how? I hope this wasn't difficult to understand, thank you !
Yui V. said: So my question is simple: Is it possible to nest a drop-down query inside another drop-down query? And how? Yes, absolutely possible.  Advanced Usage for Roll Queries provides several examples of this; I recommend playing around with the first, Example (nesting Roll Queries) .
1512495959

Edited 1512496107
Yui V.
Pro
Sheet Author
Thank you! Thanks to your advice i was able to get the code to work ! Before asking for help here I didn't pay attention to the exemples, not realising it was exactly waht I wanted to do! After noticing the first exemple cointained a drop-down within a drop-down I was pleasantly surprised and did a lot of trial and error to get what I wanted from it. It's only after an hour of two of experimenting with nesting drop-downs within nested drop-downs that i finally paid attention to the second exemple, which did just that, but right X) I feel a little dumb for not paying attention to these exemples sooner while I searched the forum and subreddit for a solution like a madman. So, if someone reading this wants to code a "tree" of options, nesting drop-downs within nested drop-downs queries, use  the second exemple on the wiki .
I'm glad you were able to figure it out!