Not sure what went wrong here but you definitely can set the string in general. Are you trying to use 'current.layoutname' specifically because you just need 'layoutname'. Is the variable of type string? If it's number it would produced NaN as a result you can see this in debug view.
Or possibly it is to do with how your event sheets are linked, it may not be reading the event at all or running it (though if you say a number worked then maybe it is running it). You can also share the file if you need further help.