I have a value in kvm .I want to get the value and in javascript If the value is higher or lesser than 100 i need to print something or else do nothing.
Can anybody help?
In the KeyValueMapOperations policy use <Get />
<Get assignTo="myvar" index="1"> <Key> <Parameter ref="variable_name"/> </Key> </Get>
The variable will be accessible in javascript policy. this that has became the flow variable. you can use like -
var new_var = context.getVariable("myvar");
Yes i need the javascript code..
The code i am using is
var num=context.getVariable("request.queryparam.kvmvalue"); if (num > 100) { greeting = "Good morning"; } else if (num< 100) { greeting = "Good day"; } context.setVariable("USER.name", greeting);
Everytime I give 100 in kvm the javascript gives me error.greeting is not defined.
Anybody can help me with this?
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |