1

how to query salesforce Labels using SOQL OR SOSL in query editor.

2
  • 2
    Custom labels are not accessible via SOQL. You will need to use the Metadata API to complete the query you are looking for.
    – NITHESH K
    Jul 28, 2017 at 6:45
  • 2
    My biggest question is why do you want to query them? What do you want to do with them once you've queried them? And where are you accessing them from (Apex or integration)?
    – pchittum
    Jul 28, 2017 at 12:07

2 Answers 2

1

You cannot do a SOQL/SOSL query on them but you can access the Labels by using Label.LabelName.

1
  • 1
    That doesn't have anything to do with what is being asked here.
    – Adrian Larson
    Jul 28, 2017 at 11:56
1

You can query the custom label using SOQL like in the Developer console: SELECT Id, Name from customlabel where name='LabelName'. Make sure you have checked 'Use Tooling API'

[enter image description here][1**]**

1
  • From API perspective , same above can be fetched with SOQL at endpoint like : https://<OrgUrl>/services/data/v48.0/tooling/query/?q=select%20Id%2C%20Name%20from%20Customlabel%0Awhere%20Name%20%3D%20%27LabelName%27 May 5, 2020 at 11:13

You must log in to answer this question.

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