1

I am designing out an ETL between salesforce and my data warehouse. I know that we have 3 different record types on a custom object, and each have a set of fields that only applies to that record type. On the REST API, would every field return in the list endpoint for every record, or only the applicable fields to the record type for that resource?

the API is Lightning Platform REST API

2
  • 3
    This depends on the REST API you're using - please update your question with more details.
    – identigral
    Commented Jul 10, 2020 at 15:55
  • the api is in the Lightning Platform REST API section in the documentation
    – Mark B
    Commented Jul 10, 2020 at 16:10

1 Answer 1

3

If you ask the REST API to describe an object's schema, or perform a SOQL query or an object retrieve by Id, all fields are exposed to you. More precisely, a describe will tell you about all fields your authenticated user has permission to see, and you may in a query or retrieve specify any of those fields, all regardless of the record type.

If you talk to the User Interface API, by contrast, you'll get back information about how to render a record in the user interface, which would take the Record Type into account in considering which fields to display.

2
  • if the API were - /services/data/v49.0/sobjects/custom_object__c/ then it would return every field in the schema if we were getting a list of records?
    – Mark B
    Commented Jul 10, 2020 at 16:57
  • That endpoint doesn't return a list of records per se - it returns object information, which includes a list of recent records. If you hit the sObject Rows resource to retrieve data without specifying fields, then yes, you get back all fields you can see.
    – David Reed
    Commented Jul 10, 2020 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .