tommeh_1337

RITM variables to summary

Sep 13th, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var answer = '';
  2. var varLabel;
  3. var varValue;
  4. var arrUtil = new ArrayUtil();
  5. var set = new GlideappVariablePoolQuestionSet();
  6. set.setRequestID(current.getUniqueValue()); set.load();
  7. var vs = set.getFlatQuestions();
  8. for (var i=0; i < vs.size(); i++){
  9.     varLabel = vs.get(i).getLabel(); //get label of variable
  10.     varValue = vs.get(i).getDisplayValue(); //get display value of variable
  11.     if(varValue != '' && varValue != 'false' && varLabel != null){ //value is not empty or false and label is not NULL
  12.         answer +=(varLabel + " = " + varValue + "\n");
  13.     }
  14. }
  15.  
  16. current.u_summary = answer;
  17. current.update();
Advertisement
Add Comment
Please, Sign In to add comment