I thought I wanted to do something quite simple but I can’t figure this one out.
I am making a widget that will show buttons for all the items in a group. As the title for these buttons I use the item labels. For certain items I use a label that I would like to transform. For that I have made a small javascript function that will transform labels based on a map I have created:
let labelMap = new Map();
labelMap.set("home","I am home");
labelMap.set("test","Test");
function mapLabel(label) {
if (labelMap[label]) {
return labelMap[label];
}
return label;
}
Problem is that it is not calling the mapping function