Video was updated in August 2024.
Workflows are a no-code way to automate analyses and reports you use often or daily. In addition, you can convert the workflows to JSL scripts to offer a smooth user experience and more polished presentation and create an add-in to share with others. This demo shows the basics of how to understand and modify workflow scripts and make them more flexible for new data and new users. It assumes you have some background in creating a JMP Workflow.
The case study uses three sources that we use to build the workflow using data from the years 2015-2017 and then make a script that can work with data from subsequent years.
The attached .zip file includes all the files you need to practice, including, two versions of the childcare Excel data and the Childcare Analysis JMP Add-In.
See how to:
- Understand some of the JSL basic components
- Comments
- Referring to columns in data tables
- Expressions and objects to which they refer
- Path variables
- Create Workflow
- Save out the workflow script
- Edit the script to generalize for new data and new users
- Change table names and file paths
- Create data table name variables
- Add user input mechanisms as needed (Pick File, Column Dialog, etc.)
- Choose a file
- Create JSL to pick a file based on specific criteria
- Default to current open data table
- Choose a column and then unload the selected column from the dialog, to act on it later in the script.
- Use embedded report Column Switcher rather than choose a column
- Optionally save the script as a JMP add-in for distribution
- Create the Add-in using File > New > Add-in
- Create a menu item and/or a toolbar item to launch the script
- Include data files, PDFs, etc.
- Install the add-in and share with other users that can install by double-clicking on the *.jmpaddin file
Questions answered by Jordan Hiller @Jordan_Hiller at the live webinar:
Q: If my workflow generates a NEW table in the process, and that new table then gets called by successive steps, I encounter issues with this because the newly formed table will be given a hard-to-predict name, like “untitled 5.” Can this step be “generalized” in a similar way?
A: The place where you will run into it especially is when you are using things in the Tables menu like stack and split and transpose, and the things that you make with stack, split, transpose. Unless you give them an explicit name, they will be called u=Untitled 17 or Untitled 32. So, name the new Output Table during the Tables menu operations.
Renamed split table
Q: If a JSL script was run without Workflow Builder, how can it be turned into a Workflow?
A: Yes, you can create a new Workflow Custom Action, then copy and paste the script into a window, or break the script up into separate Custom Actions.
Q: Could you hit Record in Workflow Builder, then run you script? Would WFB capture the steps of the script?
A: In JMP 17 and earlier, it will not capture the steps. However, JMP 18 workflows do indeed capture scripts that are run while the workflow is recording.
Q: Do you have any suggestion when running Fit Model with "by" variable? Workflow save out an instance, which has breakdown of each category? But how to make it more general when the column has new category?
A: By group scripting by groups in JSL is a bit tricky. You have to know how to handle JSL lists. I suggest you consult the JMP User community or submit a question to the User Community, and you'll get some good advice there.
Q: Is there a path variable that refers to the directory where the current running script is located?
A: No, there is not a path variable for the script. You can get around that. a lot of times when you specify a file in a JMP script, if the file lives in the same path/directory/folder in the same script you are running, you can remove the path/directory from the filename and use a relative path. See below.
Resources