Hi JK2020,
What are you trying to achieve? If I wanted to show the value of an input to the user in some sort of message, I don't think I'd need to resort to JavaScript... just use the Message tool and pass it the variable that holds the value I want to display (in this case userName).
If you really need to do it using JavaScript and the alert() method:
- Add an input parameter to your JS node, with the same data type as the userName screen variable and call it ValueToDisplay
- in your JavaScript node you simply need to add:
alert($parameters.ValueToDisplay);
Hope this helps!