Variables within includes

Each include can have its own set of local variables, in addition to the global variables inherited from the parent property's configuration. You can create new local variables that are not available in the parent property. As the include's local variables have different prefixes, there's no risk of overriding or overlapping with the global variables of the same name.

Built-in variables

All built-in variables are global in scope and work the same way in parent properties and includes. See Built-in system variables for the list of available predefined variables.

User-defined variables

In PAPI, you use local user-defined variables similarly to the global variables you declare for properties. However, you need to make sure you create an include before you can add local variables and obtain the includeId, as you'll prepend the local variable's name with the PMINC<includeId> prefix. See Declare a variable for more information.

  "variables": [
           {
               "name": "PMINC1234_EXAMPLE",
               "value": "Value of Local EXAMPLE",
               "description": "test",
               "hidden": false,
               "sensitive": false
           }
       ],

To reference a global variable that's set on the parent property level within a behavior option, prepend it with the parent. prefix. This example combines both global and local user-defined variables in a single option value:

  "behaviors": [
           {
               "name": "constructResponse",
               "options": {
                   "enabled": true,
                   "responseCode": 200,
                   "body": "string\nLocal EXAMPLE={{user.PMINC1234_EXAMPLE}}\nParent EXAMPLE={{parent.PMUSER_EXAMPLE}}",
                   "forceEviction": false,
                   "ignorePurge": true
               }
           }
       ],