Get All Picklist Definitions

Return a list of the picklist definitions for the specified tenant.

Command

GET https://{server}/api/v1/{tenantId}/picklistDefns

Parameters

Name Required Data Type Description Parameter Type
tenantId Yes String Unique identifier of the tenant. Path
filter No String Spring Expression Language (EL) filter. Allows you to filter by a set of records (for example: name eq 'name'). The following fields are filterable:
  • name

  • referenceType

  • referenceValue

For more details on using the filter query parameter, see Filtering Guidelines

Query
offset No String The number of items to skip before starting to collect the result set. Used with limit. Query
limit No String

The maximum number of results to return. Used with offset. Together, they determine the start index and number of records to return. For example, to return records 5 through 15 that have been sorted by name, use the following:

picklistDefns?offset=5&limit=10&orderBy=name

Query
orderBy No String Order by fields, sort order. Query
select No String Select the specific fields to be returned. Query
count No String The number of records to fetch from the database. Query
groupBy No String Categorization of results (group by a field). Query

Responses

Status and Error Codes

See Common Status and Error Codes.

Successful Response Body

Field Description
hostId The identifier of the host instance that is returning the request.
status The status of the request. For a successful operation, this field is always 'SUCCESS'.
content

Returns an array of records.

Field Description
pickListDefnId The globally unique database-level identifier of the picklist definition.
name Name of the picklist definition.
label Label of the picklist definition.
description A string describing the picklist definition.
tenantId The tenant ID.
referenceType

Defines the type of a picklist definition. Valid values are:

  • API
  • OBJECT
  • STATIC
fields

Defines the key/value pairs.

Field Description
key An array of one or more key fields for the picklist.
value

An array of one or more value fields for the picklist.

Field Description
expression Used in the UI to display content based on the fields in the picklist.
title The unique name for the expression. It's translated as a key that is used to display the expression in the UI.
reference

Refers to the source of the object, which can be an internal masterDataDefns object or an external API.

Field Description
name The name of an object definition. Not used if the referenceType is API or STATIC.
apiConnectionDefnId The ID of an API definition. Not used if the referenceType is OBJECT or STATIC.
apiPath The path in the API URL to the data. Not used if the referenceType is OBJECT or STATIC.
apiFormat The API format type. Not used if the referenceType is OBJECT or STATIC.
data

The data for the picklist definition. Not used if the referenceType is OBJECT or API.

The data can be expressed in a flat or nested segmented list.

A flat segmented list is a simple array of objects with a list of key/value pairs for each record. There will be a line item for each key defined in the fields section. For example:

Key Value
The name of the key. The value of the key.

A nested segmented list organizes the keys and values based on the level of the segmentation. For example:

Field Description
_k The key for the segment level.
_v

The value for the segment level. Unless this is the final segment, the value consists of another array of keys and values. If this is the final segment, it contains an object with one or more key/value pairs.

Key Value
The name of the key. The value of the key.
createdTime The date and timestamp when the picklist definition was created.
lastModifiedTime The date and timestamp when the picklist definition was last modified.
createdBy The ID the person who created the picklist definition.
lastModifiedBy The ID of the person who last modified the picklist definition.
activeFlag Indicates whether the picklist definition is active.
readOnly Indicates whether the picklist definition is read-only. A read-only picklist definition can't be edited or deleted.
messages If the status is SUCCESS, this field is always blank.
count The number of records returned.

Examples

Sample API Call
GET http://company.com/api/v1/pX3459712f8/picklistDefns
X-Application-Key: 30b5f27a684744116537882dda0e50efb8c5a6e26a7b7ad2f3fcb2c24436a840
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHB=

Successful Responses

Response Body Sample
{
    "hostId": "09071f29ceccd18667227a94122ba2f1",
    "status": "SUCCESS",
    "content": [
        {
            "pickListDefnId": "z22060618112587436363009",
            "name": "re_jobcode",
            "label": "RE Jobcode",
            "description": "Picklist by API for FieldGlass",
            "tenantId": "pX2f8122a19",
            "referenceType": "API",
            "fields": {
                "key": [
                    "jobCodeId"
                ],
                "value": [
                    "jobCodeName"
                ]
            },
            "reference": {
                "apiConnectionDefnId": "z22060618112323535908009",
                "apiPath": "/resources/{resourceId}/job-codes",
                "apiFormat": "Fieldglass"
            },
            "createdTime": "2022-06-06 18:11:25.990 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "activeFlag": true,
            "readOnly": false
        },
        {
            "pickListDefnId": "z22060618112610236222008",
            "name": "re_costcenter",
            "label": "RE Cost Center",
            "description": "Picklist by API for FieldGlass",
            "tenantId": "pX2f8122a19",
            "referenceType": "API",
            "fields": {
                "key": [
                    "costCenterId"
                ],
                "value": [
                    "costCenterName",
                    "costCenterCode"
                ]
            },
            "reference": {
                "apiConnectionDefnId": "z22060618112323535908009",
                "apiPath": "/assignments/{assignmentId}/cost-centers",
                "apiFormat": "Fieldglass"
            },
            "createdTime": "2022-06-06 18:11:26.107 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "activeFlag": true,
            "readOnly": false
        },
        {
            "pickListDefnId": "z22060618112617236391009",
            "name": "RATE_CATEGORY_PICKLIST",
            "label": "Rate Category Picklist",
            "description": "Picklist which holds all the Rate Categories pushed by FG",
            "tenantId": "pX2f8122a19",
            "referenceType": "OBJECT",
            "fields": {
                "key": [
                    "rateCategoryId"
                ],
                "value": [
                    "code"
                ]
            },
            "reference": {
                "name": "RateCategory"
            },
            "createdTime": "2022-06-06 18:11:26.190 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "activeFlag": true,
            "readOnly": false
        },
        {
            "pickListDefnId": "z22060618112628936241008",
            "name": "re_ratelookup",
            "label": "RE Rate Lookup",
            "description": "Picklist by API for FieldGlass",
            "tenantId": "pX2f8122a19",
            "referenceType": "API",
            "fields": {
                "key": [
                    "lookupId"
                ],
                "value": [
                    "name"
                ]
            },
            "reference": {
                "apiConnectionDefnId": "z22060618112323535908009",
                "apiPath": "/resources/{resourceId}/rate-lookups",
                "apiFormat": "Fieldglass"
            },
            "createdTime": "2022-06-06 18:11:26.297 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "activeFlag": true,
            "readOnly": false
        },
        {
            "pickListDefnId": "z2206091951242661979100a",
            "name": "StaticFlattenPicklist_employee",
            "label": "Static Flat Employee Picklist",
            "description": "Static Picklist is having static flatten data as given in below reference-data object",
            "tenantId": "pX2f8122a19",
            "referenceType": "STATIC",
            "fields": {
                "key": [
                    "org",
                    "dept",
                    "manager",
                    "employee"
                ],
                "value": [
                    "org",
                    "dept",
                    "manager",
                    "employee",
                    {
                        "expression": "Welcome ${employee}, ${manager}, ${dept}",
                        "title": "Greetings"
                    },
                    {
                        "expression": "Welcome ${employee}, ${manager}, ${dept}",
                        "title": "Greetings2"
                    }
                ]
            },
            "reference": {
                "data": [
                    {
                        "org": "PI",
                        "dept": "IT",
                        "manager": "Jhon",
                        "employee": "Rich"
                    },
                    {
                        "org": "PI",
                        "dept": "ITI",
                        "manager": "Ram",
                        "employee": "Lee"
                    },
                    {
                        "org": "PI",
                        "dept": "ITI",
                        "manager": "Shyam",
                        "employee": "Mack"
                    },
                    {
                        "org": "PI",
                        "dept": "ITI",
                        "manager": "Shyam",
                        "employee": "Jack"
                    },
                    {
                        "org": "PI",
                        "dept": "ITI",
                        "manager": "Shyam",
                        "employee": "Hussey"
                    },
                    {
                        "org": "PI",
                        "dept": "ITI",
                        "manager": "Shyam",
                        "employee": "Lucky"
                    },
                    {
                        "org": "BI",
                        "dept": "Sales",
                        "manager": "Kiran",
                        "employee": "Gaurav"
                    },
                    {
                        "org": "BI",
                        "dept": "Sales",
                        "manager": "Kiran",
                        "employee": "Ben"
                    }
                ]
            },
            "createdTime": "2022-06-09 19:51:24.300 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "activeFlag": true,
            "readOnly": false
        },
        {
            "pickListDefnId": "z2206091959514382001800a",
            "name": "StaticNestedPicklist_employee",
            "label": "Static Nested Employee Picklist",
            "description": "Static Picklist is having static nested data as given in below reference-data object.",
            "tenantId": "pX2f8122a19",
            "referenceType": "STATIC",
            "fields": {
                "key": [
                    "org",
                    "dept",
                    "manager",
                    "employee"
                ],
                "value": [
                    "org",
                    "dept",
                    "manager",
                    "employee",
                    {
                        "expression": "Welcome ${employee}, ${lName}",
                        "title": "Greetings"
                    }
                ]
            },
            "reference": {
                "data": [
                    {
                        "_k": "PI",
                        "_v": [
                            {
                                "_k": "ITI",
                                "_v": [
                                    {
                                        "_k": "Shyam",
                                        "_v": [
                                            {
                                                "_k": "Sagar",
                                                "_v": {
                                                    "fName": "Sagar",
                                                    "lName": "Kachave"
                                                }
                                            },
                                            {
                                                "_k": "Pradeep",
                                                "_v": {
                                                    "fName": "Pradeep",
                                                    "lName": "Raut"
                                                }
                                            },
                                            {
                                                "_k": "Roshan",
                                                "_v": {
                                                    "fName": "Roshan",
                                                    "lName": "Patil"
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "_k": "Ram",
                                        "_v": [
                                            {
                                                "_k": "Lee",
                                                "_v": {
                                                    "fName": "Lee",
                                                    "lName": "Jong"
                                                }
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "_k": "IT",
                                "_v": [
                                    {
                                        "_k": "Jhon",
                                        "_v": [
                                            {
                                                "_k": "Rich",
                                                "_v": {
                                                    "fName": "Rich",
                                                    "lName": "Brian"
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "_k": "BI",
                        "_v": [
                            {
                                "_k": "Sales",
                                "_v": [
                                    {
                                        "_k": "Kiran",
                                        "_v": [
                                            {
                                                "_k": "James",
                                                "_v": {
                                                    "fName": "James",
                                                    "lName": "Charles"
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "createdTime": "2022-06-09 19:59:51.463 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "activeFlag": true,
            "readOnly": false
        }
    ],
    "messages": [],
    "count": 5
}