Environment variable usage inside object definitions not detected by "Referenced By" in "Keys & Variables"

I have identified what appears to be a small issue with the "Referenced By" detection for environment variables in Xano.

To reproduce, create an environment variable named "testenv" and then create a function "test_env" that contains an object variable (e.g. {}) where one of the object's values references the "testenv" environment variable:

function test_env {
  input {
  }

  stack {
    var $x1 {
      value = {}|set:"key":$env.testenv
    }
  }

  response = $x1
}


After saving the function, if you navigate to the "Keys & Variables" section and inspect the "testenv" variable, the "Referenced By" does not show the function as a consumer of that environment variable, even though it is clearly being used within the object:


However, if within the same function a separate variable is created and assigned directly to "testenv" (outside of the object structure), the "Referenced By" section immediately detects the function correctly and lists it as a reference:

function test_env {
  input {
  }

  stack {
    var $x1 {
      value = $env.testenv
    }
  }

  response = $x1
}



This suggests that the reference tracking mechanism may not be detecting environment variables when they are used inside object definitions.

FA

Working with APIs
1 reply