Help Center/ Huawei Cloud Astro Zero/ API Reference/ APIs/ Metadata/ Operations on Picklist Instances/ Querying a Picklist Instance or Objects That Reference a Picklist Instance
Updated on 2025-05-13 GMT+08:00

Querying a Picklist Instance or Objects That Reference a Picklist Instance

Function

This API is used to query a specific Picklist instance or the objects that reference a specific Picklist instance.

URI

GET 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

flag

No

String

Explanation

Query mode, which is used to query a picklist instance or the objects that reference a picklist instance.

Constraints

None

Value

  • flag=R indicates that the list of objects that reference the Picklist instance is queried.
  • If flag is not passed, the Picklist instance is queried.

Default value

None

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

Object

Explanation

If the request is successful, a Picklist instance or the objects that reference the Picklist instance is returned.

Example Request

To query a Picklist instance, send the following request:
GET https://Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Picklist/000y000000aM92DCu6hU

Example Response

{
    "resCode": "0",
    "resMsg": "Success",
    "result": [
        {
            "id": "testListId",
            "name": "testName",
            "isSorted": false,
            "isRestricted": false,
            "controlField": "",
            "masterLabel": "testLabel",
            "description": "",
            "isGlobal": true,
            "isBaseline": false,
            "picklistValues": [
                {
                    "id": "testValueId",
                    "value": "A",
                    "isDefault": false,
                    "isActive": true,
                    "label": "A",
                    "sequenceNo": 0,
                    "color": "",
                    "controlFieldValue": "",
                    "description": "",
                    "isBaseline": false,
                    "createdBy": "testUserId",
                    "createdBy.name": "test0xx",
                    "createdDate": "2019-08-05 20:38:24",
                    "lastModifiedBy": "testUserId",
                    "lastModifiedBy.name": "test0xx",
                    "lastModifiedDate": "2019-08-05 20:38:24",
                    "owner": "testUserId",
                    "owner.name": "test0xx",
                    "custom": true
                }
            ],
            "createdBy": "testUserId",
            "createdBy.name": "test0xx",
            "createdDate": "2019-08-05 20:38:24",
            "lastModifiedBy": "testUserId",
            "lastModifiedBy.name": "test0xx",
            "lastModifiedDate": "2019-08-05 20:38:24",
            "owner": "testUserId",
            "owner.name": "test0xx",
            "custom": true
        }
    ]
}

Status Code

See Status Codes.

Error Code

See Error Codes.