0

I am new to salesforce.

I am trying to get the chosen value of a picklist in an object.

The name of the object is product__c. When I pass the product__c in the rest api call, it returns me the api names rather than the values. How do I get the actual values?

Basically I trying to mimic the toLabel(product__c) of the soql in rest api.

1

The User Interface API is probably what you're looking for. Use the Get Record Data and Object Metadata resource, and it'll return a bunch of information, including the value and displayValue (the API name and translated value). You get the data with /services/data/v48.0/ui-api/record-ui/record-id. Also, to get all the translations and other metadata, you can use a describe call, such as calling /services/data/v48.0/sobjects/objectName/describe.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.