Use Parameters in Templates and Quick Answers
To assign a value to a notebook variable interactively, analysts can define parameters in templates and in quick answers. A parameter is a variable specifically declared which, when the notebook is run, shows a dialog box that prompts the analyst for the value of the variable. This way, Cytomic Orion speeds up the process of assigning values to notebook variables without the analyst having to edit or modify the code.
When you run a notebook created from a template that requires parameters, a parameter request dialog box appears, similar to the one in figure Parameter request dialog box for a template. In this dialog box, the analyst must enter the values of the parameters the notebook will receive.
Parameter Format
The format you must use to define a template parameter is:
|
For each line with the above format that exists in the template, an entry is added to the parameter request dialog box. If a list-type parameter is added, a text box appears for the analyst to specify the relevant parameters separated by carriage returns.
Add Parameters to a Template or Quick Answer
To add parameters to a template:
In the first cell, add a line for each parameter with the aforementioned format.
These types of parameters are supported:
Type | Description |
---|---|
string |
Character string. |
int |
Integers. |
date |
Dates. |
list |
Lists of character strings. |
MUID |
Drop-down menu with the entity of interest MUID. |
client |
Drop-down menu with the the entity of interest client. |
MD5 |
Drop-down menu with the entity of interest MD5. |
Automatic Assignment of Parameter Values Based on the Context
When running a notebook that requires parameters, analysts must manually assign the value of each parameter in the parameter request dialog box. In notebooks that require many parameters, this task can take some time To speed up the process of assigning values, Cytomic Orion can read the context of the entity of interest from which you launch the notebook. For example, if the analyst launches a notebook from an indicator, Cytomic Orion can read the fields of the specific indicator and load their contents into the appropriate parameters in the parameter request dialog box.
For Cytomic Orion to associate a field of an entity of interest with a specific parameter required by a notebook that you want to run, these conditions must be met:
-
The parameter name and the field name must match.
-
The parameter must be declared with a basic type (int or string)
For example, an analyst defines a notebook that requires a computer MUID. To speed up the process of assigning the MUID value when the notebook is launched from an indicator, the analyst must declare the ‘MUID’ parameter with a string, because that is the name of the field that contains a computer MUID in the indicators generated by Cytomic Orion.
Assignment of Default Values to Parameters
The format you must use to assign a default value to a parameter in a template is:
|
Automatic assignment of values to parameters based on the entity context has priority over assignment of default values. That is, when you open a notebook and the parameter request dialog box appears, if the solution cannot populate a parameter field with the context information, the default value specified in the parameter declaration is added. Similarly, if a notebook has default parameters assigned, and the values of those parameters can also be automatically assigned from the entity context, the values that are finally applied are the values generated from the entity context.