I am not sure if there is a way to nest requests directly in other requests. The usual way to use it is to use a template. Thus, you can define a template (or a subpage of the template, if it is included in the template) called {{tablerow}} , which consists of:
<includeonly> |- valign="top" | [[{{{1|}}}]] | {{#show: {{{1|}}} | ?surface }}</includeonly>
The <includeonly> tags are important for reasons that I really donโt understand, sometimes errors occur if you do not leave them. Then you just run the #ask request with format = template . (You can build a title in the request, but itโs easier for me to simply set it outside.)
{| class="wikitable smwtable sortable" |- valign="bottom" ! [[City]] ! [[Surface]] {{#ask: [[Category:City]] [[location::Germany]] | format = template | template = tablerow | link = none }} |}
This will delete every result returned by the request through the template as {{{1}}} and will generate a string based on this. If you have other data to return from the main request, the additional properties that you request will exit as consecutive unnamed parameters (therefore, if you enable | ?population , this will go into the template as {{{2}}} and it will need to be add to the line structure or it will be deleted).
source share