on 2020 May 11 4:32 PM
HI, Experts
How can I use a variable from the /globals directory in an MDK rule?
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
juanforero98
You can use Client API getGlobalDefinition to access a global variable.
Example:
export default function GetValueFromGlobalVariable(context) {
let appVersion = context.getGlobalDefinition('/MDKTest/Globals/AppDefinition_Version.global');
if (appVersion.getType() == 'string') {
alert(appVersion.getValue());
}
//do something
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
24 | |
22 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.