Variables and Arrays
Work with variables and arrays in Hoverfly Cloud simulations using templating to create dynamic and flexible API responses.
Variables:
{{ putValue 'variablename' value outputtotemplate? }}{{ putValue 'id' (Request.Body 'jsonpath' '$.id') true }}{{ getValue 'variablename' }}{{ getValue 'price' }}{{ add (getValue 'price') this.tax '0.00' }}Arrays:
{{ addToArray 'arrayname' value outputtotemplate?}}{{ addToArray 'totalweight' (multiply (this.quantity) (csv 'products' 'upc' 'this.upc' 'weight') '') false}}Last updated