anton
anton

Reputation: 158

How do i get all values from a global pick list in salesforce using REST Api?

I know i can get the values of the picklist via a call to describe an object.

  1. Is it possible to get the values without adding the field to an object and to query the values regardless of the object it is used in?
  2. Is it possible to do the same with GlobalValueSets? According to the documentation they are used since API 38.0 and later.

Upvotes: 1

Views: 4551

Answers (1)

Remco
Remco

Reputation: 53

Since API 39.0 it is possible to access GlobalValueSets through the Tooling API. It is possible to access the GlobalValueSet without adding the field to an object.

The following REST call should be used:

GET /services/data/v39.0/tooling/sobjects/GlobalValueSet/{ID}

Where the ID can be found in SalesForce > Global Value Set > The Global Value Set you wish to access via the API > Grab the ID from the URL.

Upvotes: 3

Related Questions