Can't capture listbox selection in application builderHi everyone,
I'm new to jmp and I'm trying to use the application builder. I have a launch module with a listbox and two values, "ER" and "IL". Once a user presses a button, I'd like to be able to capture which selection(s) they chose, if any.
For some reason, when I print "AnalysisSelected" to the text box, the text that appears is "List". It works if I choose to only print "AnalysisSelected[1]" to the text box, but I want to be able to loop through the selected analyses and take proper action once I pass the variable to the GraphBuilder...
Thanks in advance!!

Re: Can't capture listbox selection in application builderYou're close. A few notes:
- list(AnalysisSelected) does not do anything but create {AnalysisSelected}.
- Get Selected for a listbox returns a list
- If you're trying to put a number into a text box you need to convert it to a character with char().
Try this code:
analysis_list = analysistypes << get selected;
var = nitems(analysis_list);
if (var > 0,
analysisselected = analysis_list[1]; // Assumes you're restricting # choices to 1
,
error text << set text(char(var));
);
Re: Can't capture listbox selection in application builderA list box is container for any kind of display boxes to display them in sequence vertically or horizontally. Is AnalysisTypes a radio box?
JSL as far as I know does not use the "this"/"self"/"me" convention of object-oriented languages, so that part of your script is not doing anything.
If AnalysisTypes is a radio box and Error Text is a textbox, your function should look like this:
RunAnalysis = function({},
AnalysisSelected = AnalysisTypes << Get Selected;
//show(AnalysisSelected);
Error Text << Set Text(AnalysisSelected);
);
The "show(AnalysisSelected)" line is commented out, but you can uncomment that line and see what the value of that variable is in the log. That is a really handy function to use for debugging.
I attached a working example in App Builder using this script.
You said you are new to JMP, and I would recommend taking the time to learn the fundamentals of JSL before jumping right into App Builder. That's a lot to try to chew for a new user. Jump Into JMP Scripting by Wendy Murphrey and Rosemary Lucas is a fantastic book that I would highly recommend purchasing if you plan to use JSL a lot. I wrote a gentle introduction to Application Builder a couple years ago that you may also find helpful: https://community.jmp.com/t5/Discussions/Gentle-Introduction-to-Application-Builder/m-p/49629#M28232