--- title: "add to map()" slug: "basic-add-to-map" updated: 2026-08-10T07:41:33Z published: 2026-08-10T07:41:33Z canonical: "docs.lobstersoftware.com/basic-add-to-map" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # add to map() Adds value **b** with key **a** into map **c**. If the map does not exist, it is created. The return value of the function is always **b**. ## Parameters | Parameter | Description | | --- | --- | | a | Key value. | | b | Value to be added. | | c | Name of the map. Default: "default". | | d | (optional) "true", if values with set Empty Flag should not be added to map. Default: "false". | ## Example | Parameter a | Parameter b | Parameter c | Parameter d | Result | Value added to map | | --- | --- | --- | --- | --- | --- | | MyKey | Hallo (empty flag not set) | MyMap | | Hallo | Yes. | | MyKey | Hello (empty flag set) | MyMap | false | Hello | Yes. | | MyKey | Hällo (empty flag set) | MyMap | true | Hällo | No. |