+ Start a Discussion
Simon BramiSimon Brami 

How to get label on custom fields using REST API ?

Hi, I am using the rest api query and I need to get the label that appear on salesforce but I don't know how to do it.
For example if I want the value and de label it would be something like : query?q=select Custom__c, Custom__c.label from Account 
Thanks
Raj VakatiRaj Vakati
Use tooling API. Sample is here 
 
/services/data/v41.0/tooling/query/?q=SELECT+Id,Label,+QualifiedApiName+FROM+FieldDefinition+WHERE+EntityDefinition.QualifiedApiName+=+'Account'+AND+QualifiedApiName+=+'Name'

 

 
sivaextsivaext
Hi Simon, 

To get field information like label, length etc.
API for Sobject Describe - /services/data/v41.0/sobjects/Account/describe
The Response contains all account fields with the field label and other information.

Regards,
Siva.
Simon BramiSimon Brami
Thanks both of you, but I need to get the information in a query in order to extract the data to another database, I need the value of my custom__c and its label :/ For the moment I get the value by doing query?q=select Custom__c from Account but I need its label too.. Do you know how to do it in the same query ?

Regards