R12.1 JA-2025July15

Define Variable

    Variables in NI can be categorized in the following ways: 

    Categorized by Variable Classification

    Variable Classification
    Description
    Sample
    Parser Variable
    Parser Variable refers to the variable extracted from CLI commands under the Define Variable tab in NI.

    Compound VariableCompound variable can convert the single variable into different formats or calculates new variables using two or more existing single variables.

    Compound Table
    Compound table can merge two table variables in the same NI into one table variable, including merged table, sub table, and appended table.

    Macro Variable
    Macro variables are variables with a pre-defined default value.

    Task Variable

    Task variable can be read and written across home intent and follow-up intents to pass information from home intent to any follow-up intents. It can be used in the Triggered Automation Framework (TAF), auto intent, and bot.


    Critical Variable

    Critical variables are used to qualify devices for the intent template when it is replicated to related devices. All variables used in diagnosis and CLI commands can be set as Critical Variables.


    Signature Variable

    The signature variable is a specific type of variable, and it is aimed to expose the main variable values used in the parser when NI is used for NIT replication. It can also be used in ADT for outputting values.




    Built-in Table
    The device built-in data are supported in intent, such as Route Table, Topology Table, and NCT.

    ADT
    ADT is an extended global data table for managing the critical network assets and network intents associated with those network assets.

    Built-in Variable
    such as $this_device, $device_name.

    Categorized by Variable Type

    Variable Type
    Description
    Sample
    String
    Match any single word.
    Device hostname can be parsed by parser with string variable, such as hostname CA-TOR-SW1 --> Hostname $hostname (string).

    Mstring

    Match one or multiple words.

    Information Note: A mstring variable cannot be followed by another mstring variable.
    device neighbor can be parsed by parser with mstring variable.

    Int
    Match any whole number.

    Float
    Match any double-precision IEEE 64-bit (8-byte) floating-point number.
    Device version can be parsed by parser with string variable, such as Version 15.4 --> Version $version (float).

    Object
    See Support Native Objects for more information.
       
    Bool
    See Support Variables of List Type and Bool Type for more information.

    List

    Table
    Match any information that can be converted into a table.
    Device ip route can be parsed by parser with table variable.


    Categorized by Variable Scope

    Variables in NI can be classified based on their scope as local variables and global variables.