Next-Level Automation Using JSL ScriptingThis webinar is in English, 2:00 p.m. US Eastern Time.
JMP workflows allow you to capture, replay and share your point-and-click data work. Learn how to convert single-use workflows to user-friendly scripts that work across different users and data sources. The session is designed for JMP users who have some background in creating a JMP Workflow. See a concise 30-minute demo followed by 15-30 minutes of Topic Discussion and Q&A.
This webinar covers: simple modal windows for user input and related JSL syntax.
Automation and ScriptingEnglishMastering JMPRe: Next-Level Automation Using JSL ScriptingFrom Anderson Mayfield @abmayfield 05-31-2023 01:41 PM
Thank you all for putting this together. I have a follow-up question on "generalizing," and it has more to do with my lack of scripting ability. Normally in my workflow, I need to "select all columns" and then do something, whether it be summarize, group, explore missing values, etc. However, I have thousands of columns, and they will have different names in each new data table, so I can't just replace 5,000 columns when it prompts me that it can't find one particular column (would take hours). I am wondering if I can group the columns FIRST and then carry out the remaining workflow steps on the group. I could give the group a generic name.
The alternative would be to try to select columns by a property in their name, as in the script below. If there way to script it to where the next step in the workflow features the SELECTED columns generated by this script? For instance, if I wanted to transpose all columns with "the" in the name, could this script be embedded in a workflow? I'm trying to think of how to circumvent having to recode column names in each file, though that is yet another option!
I realize Workflow Builder likely works best when you've got dozens of identically formatted tables to crunch, but I am trying to figure out if I could get it to cooperate when each table differs slightly.
names default to here(1);
dt=current data table();
colNames = dt << get column names(string);
for each({Name}, colNames,
if(contains(Name,"nox"),
for each row(
column(name)[row()] = ???????????; // your formula here
)
);
);
Re: Next-Level Automation Using JSL ScriptingFrom @Jordan_Hiller 06-03-2023 06:49 PM
If I understand your question, @abmayfield, you're asking if a JMP17 workflow can accommodate a large number of changing column names. I'll say yes it's possible, but not without inserting some custom JSL into the workflow.
One good approach is to have your workflow/script act on the columns that the user selected before running the workflow.
Here's an example using the Blood Pressure sample data set.
Names Default To Here( 1 );
//Custom JSL: Get the user-selected columns, save them into list CNames
CNames = Current Data Table() << Get Selected Columns;
//Slightly modified workflow step: replace hard-coded columns with list CNames
Data Table( "Blood Pressure" ) << Transpose(
columns( CNames ),
By( :Dose ),
Label( :Subject ),
Output Table( "tdata" )
);
However you attack this, the solution will probably involve JSL lists. Learning a little bit about lists can give you new coding superpowers!
Re: Next-Level Automation Using JSL ScriptingTo @hogi who asked Could you hit Record in Workflow Builder, then run you script? Would WFB capture the steps of the script?
Yes , JMP 18 workflows do indeed capture scripts that are run while the workflow is recording.
Re: Next-Level Automation Using JSL ScriptingHi @gail_massari , this is a great improvement. It speeds up the way how user generated code can be added to workflows. Thanks for implementing it!
I hope the next step :Workflow Builder + AddIns will come soon 
Re: Next-Level Automation Using JSL ScriptingThanks @hogi We'll see how the request for workflow builder and add-ins tracks for JMP 19.