function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vidya DVidya D 

Accessing CustomLabel in javascript by using param

Is it possible to get CustomLabel value dynamically using javascript function variable

for e.g

var abcd = function(pageName, label1) {
       $linkLets.take({
            pageId: pageName,            
            label:{!JSEncode($Label[label1])}

            
       });        


I am getting error label1 as unknown property.

Also came across this idea
https://success.salesforce.com/ideaView?id=08730000000hhVGAAY

Just want to confirm it is not possible.

 
logontokartiklogontokartik
No you need to know the Label name to access it today, You can get the Label names dynamically. I am not sure about requirements, but maybe you can try using Custom Settings. 
Shaijan ThomasShaijan Thomas
You can try the following
Create a get set variable in controller. Set the lable value to the variable.
Use the Controller variable in Javascript
Thanks
Shaijan
Shaijan ThomasShaijan Thomas
Did you get any solution for this?
Shaijan