{"title":"set_key - Liquid Filter Reference","slug":"set-key-filter-reference","url":"https://support.storeconnect.com/articles/set-key-filter-reference","url_markdown":"https://support.storeconnect.com/articles/set-key-filter-reference.md","subtitle":null,"summary":"Assigns a value to a specific key in a map. Creates the key if it does not exist, or overwrites the existing value.","type":"Developer_Documentation","video_url":"","keywords":"liquid, filters, set_key, maps, storeconnect","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"## Description\n\nSets a key in a map to a value\n\n| Property | Value |\n|----------|-------|\n| **Return Type** | map |\n| **Category** | maps |\n\n## Examples\n\n\n```liquid\n\n{{ my_map | set_key: \"age\", 3 | json }}\n```\n\n\n**Output:** `{\"name\":\"Fido\",\"type\":\"dog\",\"age\":3}`\n\n\n```liquid\n\n{{ my_map | set_key: \"type\", 3 | json }}\n```\n\n\n**Output:** `{\"name\":\"Fido\",\"type\":3}`"}