Hi Reynaldo,
Thank you for your inquiry. As per my understanding of your use case, you have created a script token named HOST_ENV and want to get the value of this token in some custom script. If this is your case, then you can make use of token service and get the value of your HOST_ENV token.
In this case, you will have to use the resolveToken method.
You can refer to the JavaScript API documentation for this function below:
https://www.dundas.com/support/api-docs/js/#API%20Reference/dundas/data/TokenService/Methods/resolveToken.html
Using this function, I have prepared a sample script that you can refer to for resolving tokens:
/resolve token/
var tokenService = this.getService(“TokenService”);// assuming you are using this code on the ready event of your dashboard
var resolvedTokenValue = tokenService . resolveToken ( “14115041-f333-4c22-b1e9-a0dec39e1a1d” ); //id of your HOST_ENV token
resolvedTokenValue . done ( function ( resultString ) {
console . log ( resultString ); //resultString contains the value of your token
});
You can get the id of your script token from the admin panel (Admin>>System>>Tokens>>Edit the HOST_ENV token).
This will return the value defined for the token:
I hope this answers your question.