Topic on Extension talk:ParserFunctions

using #ask with template result format in #expr

3
Summary by Kghbln

Use import-annotation=true with the #ask parser function

Paul LEMPERIERE (talkcontribs)

Hello !

I'm trying to use a #ask query using template format embedded in à #expr parser, but it doesn't work. Here is what it lookslike :

{{#expr: {{#ask: [[Property1::Value1]] | ?Property1 | ?Property2 | format=template | template=Template1 }} }}

The result of my #ask is an addition string, something like 1+2+7+6+4+9+2.

It seems to be the use of the template result format that causes this problem.

Here is the message I get : Expression error: Unrecognized punctuation character "["

Thanks for your help !!!

Paul LEMPERIERE (talkcontribs)

Ok I get it : it was the markers [[SMW::on]] and [[SMW::off]] generated during the pre-processing template invoked in the #ask who was made him crash.

So I used the import-annotation=true in the query like that :

{{expr: {{#ask: [[Property1::Value1]] | ?Property1 | ?Property2 | format=template | template=Template1 | import-annotation=true }} }}

And it works !

Kghbln (talkcontribs)

Great that it worked out for you. You may always use the sandbox wiki to test things.