How to use Environment variable in default field in an app Follow
If you want to display a specific environment variable on your Application:
1. Create a JS Service which calls the value of Environment Variable
In the JS editor, you should set on the return:
return {
"<ID of the parameter in the HTML that you want to set>" : ServiceManager.getEnvVar("<name of Environment variable you want to get>")
}
for example:
return {
"DB":ServiceManager.getEnvVar("DB_CONN_STR")
};
2. Set the field on the Application
a) on step 3 of the desired Page: add custom field with the same name of the parameter returned on the JS and set the default value as ${env.VARIABLE_NAME}
b) on step 4: add onLoad event which executes the JS service you have just created
c) Save and run the app. You should see the environment variable value
Comments
0 comments
Please sign in to leave a comment.