--- title: "replace item/value in map()" slug: "basic-replace-token-in-map" updated: 2026-08-12T08:14:30Z published: 2026-08-12T08:14:30Z canonical: "docs.lobstersoftware.com/basic-replace-token-in-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. # replace item/value in map() This function replaces value of key **a** in map **b** with value **e**. If **d** > 0 and a delimiter **c** is given, the value in position **d** of the itemised map value (with the delimiter **c**) will be replaced (see examples for better understanding). The return value of the function is the new value of key **a**. ## Parameters | Parameter | Description | | --- | --- | | a | Key value | | b | Name of the map | | c | Delimiter | | d | Number of item (map value of key **a** is itemised by delimiter **c**) to be replaced. See examples | | e | Value to be set | ## Examples Assume a map *myMap* with the values {*key1=value*, *key2=val1;val2*}. | Parameter a | Parameter b | Parameter c | Parameter d | Parameter e | Result | | --- | --- | --- | --- | --- | --- | | key1 | myMap | | | newvalue | newvalue | | key2 | myMap | ; | 2 | newvalue | val1;newvalue | | key2 | myMap | | | newvalue | newvalue | | key | myMap | | | newvalue | newvalue | | key1 | myOtherMap | \| | 3 | newvalue | \|\|newvalue |