Skip to content
Log in

set_key - Liquid Filter Reference

On this page

Description

Sets a key in a map to a value

Property Value
Return Type map
Category maps

Examples

liquid {{ my_map | set_key: "age", 3 | json }}

Output: {"name":"Fido","type":"dog","age":3}

liquid {{ my_map | set_key: "type", 3 | json }}

Output: {"name":"Fido","type":3}

Was this article helpful?

Was this article helpful?