Differentiating between environment for Perspective?

I made a previous post here where I asked about how to tell where the client is running from/to conditionally run gateway scripts only on the production server here - Good way to make sure my gateway scripts only run on the server?.

Now, I am attempting to do the same thing but for perspective but only really fro front end purposes (as my gateway scripts already have ways to tell). How can I accomplish this? I tried an expression property on a component to see if any of the following would work but they do not -

tag(tag({[System]Client/Network/GatewayAddress.Value}) which returns a bad_eval, because perspective does not have tags, but I was hopeful when I saw the tag function as a possibility.

I also tried runScript("system.util.getGatewayAddress") but this also gives me a bad eval.

Anyone have a way to do this? This is all to just get something in my perspective header to say “BETA” when your accessing the perspective project from our beta gateway and “PRODUCTION” when you access the perspective project form the production gateway.

You could use session.gateway.address.

1 Like