Skip to content

Is there a way to set an environment-specific global variable usable inside Event Actions (similar to how $INSTANCE works for Connect readers), so something like an external REST API endpoint URL doesn't need to be manually re-entered every time an updated app package is imported into DEV, TEST, and PROD?

Answer

There's no direct built-in global-variable mechanism for this inside Event Actions, but Custom Attributes on an Event provide a workable equivalent: add a Custom Attribute that calls a PL/SQL function (in your own custom utility API) which simply returns the correct value for whichever environment it's running in. Implement that same function in each environment (DEV, TEST, PROD, etc.), each returning its own environment-appropriate value, and the Event Action can then use that Custom Attribute exactly like any other attribute passed from the event — giving you an environment-aware value without manually updating a hardcoded URL after every package import.

← Browse Integrations and APIs questions