Updated on 2025-05-13 GMT+08:00

Adding Values to a Picklist Instance

Function

This API is used to add values to a Picklist instance specified by picklist_id.

URI

POST Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Picklist/{Picklist_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

Picklist _id

Yes

String

Explanation

Picklist instance ID, which can be queried by invoking the API of Querying Picklist Instances by Condition (id in the response message).

Constraints

None

Value

None

Default value

None

Request Parameters

Table 2 Request parameter

Parameter

Mandatory

Type

Description

picklistValues

Yes

Array

Explanation

Add one or more values to a Picklist instance.

Constraints

Semicolons (;) are not allowed in the value. The value to add must be different from any existing value of the Picklist instance.

Response Parameters

Table 3 Response parameters

Parameter

Type

Description

resCode

String

Explanation

Return code.

Value

If the request is successful, 0 is returned. For details about other error codes, see Error Codes.

resMsg

String

Explanation

Message returned.

Value

If the request is successful, "Success" is returned. In other cases, an error message is returned.

result

String

Explanation

If the request is successful, 1 is returned.

Value

None

Example Request

To add a value to a Picklist instance, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Picklist/000y000000aM92DCu6hU
{
    "picklistValues": [
        {
            "value": "F",
            "label": "ff"
        }
    ]
}

Example Response

{
    "resCode": "0",
    "resMsg": "Success",
    "result": 1
}

Status Code

See Status Codes.

Error Code

See Error Codes.