[comment]: # translation:outdated

[comment]: # ({6698fb90-6698fb90})
# valuemap.create

[comment]: # ({/6698fb90-6698fb90})

[comment]: # ({34b10afc-37547a16})
### Descrizione

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

Questo metodo consente di creare nuove mappe dei valori.

::: 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]: # ({/34b10afc-37547a16})

[comment]: # ({82893d24-efa9b6ec})
### Parametri

`(object/array)` Mappe valori da creare.

Il metodo accetta mappe valori con le [proprietà standard delle mappe valori](object#value-map).

[comment]: # ({/82893d24-efa9b6ec})

[comment]: # ({6809040a-6809040a})
### Valori restituiti

`(object)` Restituisce un oggetto contenente gli ID delle mappe di valori create
nella proprietà `valuemapids`. L'ordine degli ID restituiti corrisponde
all'ordine delle mappe di valori passate.

[comment]: # ({/6809040a-6809040a})

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

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

[comment]: # ({07a2014d-ace763eb})
#### Creazione di una mappa dei valori

Creare una mappa dei valori con due mappature.

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

```json
{
    "jsonrpc": "2.0",
    "method": "valuemap.create",
    "params": {
        "hostid": "50009",
        "name": "Service state",
        "mappings": [
            {
                "type": "1",
                "value": "1",
                "newvalue": "Up"
            },
            {
                "type": "5",
                "newvalue": "Down"
            }
        ]
    },
    "id": 1
}
```

Risposta:

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

[comment]: # ({/07a2014d-ace763eb})

[comment]: # ({58f99a13-58f99a13})
### Fonte

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

[comment]: # ({/58f99a13-58f99a13})
