C3 AI Documentation Home

Parameters

Parameters are global variables that can be used across multiple nodes in a visual notebook. Use parameters to:

  • Filter or manipulate data based on dynamic timestamp values
  • Create placeholder values for commonly used numbers or strings
  • Quickly update multiple instances of a value in a visual notebook

Parameters are supported in select Input Data nodes, nodes that allow custom SQL, and schedules.

Create a parameter

Open a visual notebook to create and manage parameters. Once in the visual notebook canvas, select the curly bracket icon highlighted in Figure 1 to display the parameter modal.

example

Figure 1: Parameter button

example

Figure 2: Parameter modal

Select Create New Parameter to create a new parameter. Parameters can use a variety of pre-defined functions. To view a list of available functions, select Show Function Library.

example

Figure 3: Built-in function library

When defining a parameter, you must specify the data type, name, and formula. Parameters support embedding a function inside another function. For example, plusWeeks(current_date(), 3) is a valid parameter formula. Additionally, parameters support basic arithmetic when defining an integer or double.

example

Figure 4: A variety of configured parameters

Select Save Parameters to begin using parameters in your visual notebook.

Use a saved parameter

To use a parameter in an Input Data node, define a SQL query or use the optional Filter by Value widget. Within the Filter by Value widget, toggle the Parameter mode switch on. Toggling this switch populates the Define Value field to include all configured parameters.

example

Figure 5: Parameter Mode toggle in Input Data nodes

Once a parameter is selected, select Preview Parameter to see the formula for the chosen parameter and the current parameter value.

example

Figure 6: Preview Parameter modal

Parameters can also be used in nodes that allow custom SQL, such as Custom SQL Function, Filter by SQL, Split by Filter, and select Input Data nodes. Supported nodes include a list of configured parameters underneath the SQL Formula field.

To use a parameter, prefix it with $. Depending on the SQL functions used, you may need to encase the parameter in single quotes or curly brackets.

example

Figure 7: Parameter used in a custom SQL expression

Nodes that are configured to use parameters display a curly bracket icon when viewed on the canvas.

example

Figure 8: Parameter indicator on nodes

Was this page helpful?