how to query salesforce Labels using SOQL OR SOSL in query editor.
-
2Custom labels are not accessible via SOQL. You will need to use the Metadata API to complete the query you are looking for.– NITHESH KJul 28, 2017 at 6:45
-
2My 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)?– pchittumJul 28, 2017 at 12:07
2 Answers
You cannot do a SOQL/SOSL query on them but you can access the Labels by using Label.LabelName
.
-
1That doesn't have anything to do with what is being asked here.– Adrian Larson ♦Jul 28, 2017 at 11:56
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'
[][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