how to update the Variable label dynamically. i have Variable as type: Label

sk59
Tera Expert

I want to change the label of the variable based on some conditions. The type of the Variable is :Label

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage

Hi, try using something like the following code in a catalog client script. Please note that you will need to add in there the sysid of you variable.



variableSysID = '4183304f4f9b0200fbb73fb28110c75a';


gel('label_IO:' + variableSysID).childNodes[0].childNodes[1].innerHTML = 'My new Label Text Here';



Thanks,


Berny


View solution in original post

7 REPLIES 7

aw_devoteam
Kilo Expert

Have you considered creating a second label, then making the first label visible false and the new label visible true with a catalog ui policy?


Yes I thought of the same approach.


But I am looking for a solution which I can update the existing label instead of creating a new variable because I have so many conditions and for each condition the label should be different.


Bharat23
Kilo Guru

Did you try setLabelOf(fieldname, label) else change it using DOM


This is best practice