3

I'm able to achieve a rest api request using this url.

na35.visual.force.com/services/data/v38.0/sobjects/custom_object__c/describe

the problem I have is it returns a ton of data. I just need a few fields from the sObject and the picklist values of those fields. The meta data. I'm creating a form to create new records.

How is it done?

| improve this question | | | | |
  • Will querying data work for you? if so try /services/data/v38.0/query?q=select "fieldstoquery" from object__c where "Your_Criteria" developer.salesforce.com/docs/atlas.en-us.api_rest.meta/… – Rao Feb 2 '17 at 18:07
  • @Rao I don't think so. I believe the query url is for the records themselves. I need the meta data for the picklists – Tyler Zika Feb 2 '17 at 18:09
  • You can also query CustomField for custom fields, but there's a limitation that you can only query one field at a time, which is likely to be far less efficient, and only custom fields, not standard fields. That's part of the Tooling API. – sfdcfox Feb 2 '17 at 18:15
3

You can only describe the entire object, including all fields. Fortunately, you can cache the data and use the If-Modified-Since header to avoid wasting bandwidth between each call. See Get Object Metadata Changes.

Example SObject Describe request

/services/data/v29.0/sobjects/Merchandise__c/describe

Example If-Modified-Since header used with request

If-Modified-Since: Wed, 3 Jul 2013 19:43:31 GMT

Example response body

No response body returned

Example response status code

HTTP/1.1 304 Not Modified
Date: Fri, 12 Jul 2013 05:03:24 GMT
| improve this answer | | | | |

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.