Monazza Khokhar
05/28/2024, 10:59 PM{{#lt request.headers.foo.0 100}}Yes{{else}}No{{/lt}}
Lee Turner
05/29/2024, 8:52 AMMonazza Khokhar
05/29/2024, 3:20 PMLee Turner
05/29/2024, 3:57 PM3.6.0
) we added the val
helper which allows you to assign a value and maintain its type. The trick here is to do something that converts your header value into an actual int. I think we can use the math
helper for this. I have just been playing around with a response that looks like this:
{{val (math request.headers.foo.0 '-' 0) assign='foo'}}
{
"val":{{foo}},
"text:":"{{#lt foo 20000000}}Yes{{else}}No{{/lt}}"
}
This returns:
{
"val": 100000000,
"text:": "No"
}
Or:
{
"val": 10000000,
"text:": "Yes"
}
Monazza Khokhar
05/30/2024, 10:17 PM