Just by way of explanation (and an alternative), queries-in-attributes don't work because of Roll20's order of operations . Attributes are expanded before queries are resolved, so you'll never get the data you're looking for. One alternative is to do as Hardcore Hero just demonstrated, and embed the entire output in the query. The downside is that you have to create a new entry in the query for every character (or token, depending on what you're doing), and you have to escape certain HTML characters that act like control characters for the parsing of the query (the pipe, comma, and right-brace). That's why you'll see things like: } | , } ... and why you'll get the suggestion to use a character sheet as a macro mule, since they don't revert these HTML substitutions to their resolved display counterparts. (DGMW, using a mule sheet is still a good suggestion, regardless! ... there are more benefits than just not-having-to do HTML replacements over and over.) However, one other option is to use metascripts (even for standard output like a template). Metascript Option 1 Metascripts, since they are scripts, operate in the time period after Roll20 parsers have already handled the message. That means that we can let queries resolve, and use their returned value as part of a "go get this from that sheet" process. Since we can rely on the query being resolved, we no longer need to embed a bunch of template syntax in each option. We can agnosticize the output a bit. To do this, we're going to use the metascripts Fetch and ZeroFrame (see the Output paragraph, below, for the ZeroFrame portion). First, we're going to turn a standard Roll20 attribute retrieval construction like this: @{Character|attribute} ...into a Fetch construction for that same attribute: @(Character|attribute)
OR
@(Character.attribute) Then we'll use your query to provide either the character or the attribute (or, hell, both). Here is asking for the character: @(?{Which Character?|Bob the Hirsute|Toe Jam|Cletus|Honky}.attribute) By the time Fetch sees that in the command line, it will look something like: @(Cletus|attribute) ...and Fetch will go get the attribute from the Cletus sheet. Metascript Option 2 We can hold to something closer to what you initially asked about (basically: can I select a character without having to select a character) by adding SelectManager to the mix and changing our Fetch constructions slightly. (We'll also still require ZeroFrame; I'll show why in the Output paragraph, below). SelectManager can virtually select tokens using a {&select...} tag: {&select Bob the Hirsute, Cletus} And since it runs after the R20 parsers, the token selected can be chosen from a query: {&select ?{Which Character?|Bob the Hirsute|Toe Jam|Cletus|Honky} } Nothing is actually changed on the VTT, but for the purposes of the scripts that will see the message after SelectManager makes this change, it will appear that the token you selected from the dropdown will be "selected." Once you've got that in place, you can change your Fetch constructions to use the selected token: @(selected.attribute) (obviously to return an attribute the token will have to be set up to represent a character, and that character will have to have the attribute -- otherwise you'll get an empty string returned to your command line -- see the Fetch documentation for more info). Output Since we'd be using metascripts to accomplish this, the message has to start out as a bangsy message, intended for the Script Moderator. Bangsy messages don't hit chat: !You will never see this message. You'll never see that line hit the chat because instead of being sent to the chat output, it is sent to the Script Moderator. To output a message at the end, you can use the {&simple} tag from ZeroFrame: !You'll see this message.{&simple} The simple tag can go anywhere in the message. As long as that portion of the message survives until ZeroFrame sees it, ZeroFrame will halt further mod script processing after the metascripts and will instead output a message. ("Survive" in the sense that if you put the {&simple} tag in a query option that you don't choose, or in an APILogic IF conditional that doesn't pass true/false testing, then it won't remain in the command line.) Putting it all together, here is an example command line doing what you want to do: !/w gm &{template:default}{{name=Proof of Concept}}{{Character=@(selected.character_name)}}{{Attribute Value=@(selected.hp)}}{&select ?{Which character?|Cletus|Leroy|McMackleSmacker} }{&simple}