Math on dotLiquid not working properly

152 views
Skip to first unread message

João Cardoso

unread,
Feb 11, 2021, 10:34:17 AM2/11/21
to dotliquid
Hi,

I'm developing a solution in Azure Logic Apps and i need to convert a JSON-JSON. As far as i'm aware it uses dotLiquid.

The issue is that
{% assign qty = value2 | Plus : 0 %}
{{value | Times: qty}}

where value2 was a string, returns "Liquid error: Parameter count mismatch"

Trying to find clever ways to cheat this,

i did a for loop
{% for i in {{qty | Plus : 0 }} %}
            {% assign dumb = i %}
 {% endfor %}


The issue is that this number isn't correct, but it will give me qty in ASCII, (3=51 for example)


If anyone could help i would appreciate

David Burg

unread,
Feb 11, 2021, 12:43:01 PM2/11/21
to dotl...@googlegroups.com
Yes logic app uses dotLiquid.

I am unsure that math operation on string input instead of numerical types will yield the desired results.

A specific input to reproduce your problem would be helpful. You may want to simplify the issue as well by assigning the value directly in a test template. Minus filter casing differences, you can then test the behavior directly on the dotliquid test website without any overhead by logic app.

With regards,

David.


From: dotl...@googlegroups.com <dotl...@googlegroups.com> on behalf of João Cardoso <joaoped...@gmail.com>
Sent: Thursday, February 11, 2021 7:34:17 AM
To: dotliquid <dotl...@googlegroups.com>
Subject: [dotliquid] Math on dotLiquid not working properly
 
--
You received this message because you are subscribed to the Google Groups "dotliquid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotliquid+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotliquid/654bb6c9-b814-42e4-9067-2eac602a2721n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages