Roles[i].name looks like a String says its a String .... (?)

Hopefully the Quality of my questions if improving.

I am generating a dropdown menu with buttons that links to a page based on the Member Roles.

Setting the button.label to roles[i].name works
$w( ‘#submenubtn1’ + mnucnt).label = roles[i].name;

Setting the button.link to “/” + “test” + “-info” works
$w(‘#submenubtn’ + mnucnt).link = “/” + “string” + “-info”;

Setting the button.link to “/” + roles[i].name + “-info” does not work
$w( ‘#submenubtn’ + mnucnt).link = “/” + roles[i].name + “-info” ;

I tried toString (roles[i].name) - did not work. 

get/set link : string.
UserRole.name : string

Setting the button link to "

I’m guessing I am doing something obviously wrong here.

I will probably try .description next if I can’t figure out what I am doing wrong here.

Thank for any clues you might have for me.
Robert

Well I have found many ways of casting an object to a string in the below example. Implicit +, toString(), const (also tried let), assignment.

How do I get the string for userRole.name or .description into my button link? :slight_smile: