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?
Thanks for your feedback! It helps us improve our docs.