[comment]: # translation:outdated

[comment]: # ({6b085503-6b085503})
# valuemap.update

[comment]: # ({/6b085503-6b085503})

[comment]: # ({932b4e3f-ab463b0c})
### Descrizione

`object valuemap.update(object/array valuemaps)`

Questo metodo consente di aggiornare mappe dei valori esistenti.

::: noteclassic
Questo metodo è disponibile solo per il tipo di utente *Super admin*.
I permessi per chiamare il metodo possono essere revocati nelle impostazioni del ruolo utente. Vedere
[Ruoli
utente](/manual/web_interface/frontend_sections/users/user_roles)
per ulteriori informazioni.
:::

[comment]: # ({/932b4e3f-ab463b0c})

[comment]: # ({fd9eb722-0094db2a})
### Parametri

`(object/array)` [Proprietà della mappa dei valori](object#value-map) da aggiornare.

La proprietà `valuemapid` deve essere definita per ogni mappa dei valori, tutte le altre
proprietà sono facoltative. Verranno aggiornate solo le proprietà passate, tutte
le altre rimarranno invariate.

[comment]: # ({/fd9eb722-0094db2a})

[comment]: # ({0dbe7e67-0dbe7e67})
### Valori restituiti

`(object)` Restituisce un oggetto contenente gli ID delle mappe di valori aggiornate nella proprietà `valuemapids`.

[comment]: # ({/0dbe7e67-0dbe7e67})

[comment]: # ({b41637d2-b41637d2})
### Esempi

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({ff5e06e9-571fcc62})
#### Modifica del nome della mappa dei valori

Modificare il nome della mappa dei valori in "Device status".

[Richiesta](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "valuemap.update",
    "params": {
        "valuemapid": "2",
        "name": "Device status"
    },
    "id": 1
}
```

Risposta:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "valuemapids": [
            "2"
        ]
    },
    "id": 1
}
```

[comment]: # ({/ff5e06e9-571fcc62})

[comment]: # ({1b91e008-7b3b6bc4})
#### Modifica delle mappature per una mappa dei valori.

[Richiesta](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "valuemap.update",
    "params": {
        "valuemapid": "2",
        "mappings": [
            {
                "type": "0",
                "value": "0",
                "newvalue": "Online"
            },
            {
                "type": "0",
                "value": "1",
                "newvalue": "Offline"
            }
        ]
    },
    "id": 1
}
```

Risposta:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "valuemapids": [
            "2"
        ]
    },
    "id": 1
}
```

[comment]: # ({/1b91e008-7b3b6bc4})

[comment]: # ({fc02e5cf-fc02e5cf})
### Fonte

CValueMap::update() in *ui/include/classes/api/services/CValueMap.php*.

[comment]: # ({/fc02e5cf-fc02e5cf})
