var recSYSID = '1ba630c0c301c3105c97bdac050131a5'; var table = 'x_cls_clear_skye_i_group_operations'; getVarsSimple(recSYSID,table); getVarsComplex(recSYSID,table); function getVarsSimple(recSYSID, table) { var now_GR = new GlideRecord(table); gs.info('getvars SIMPLE:'); if (now_GR.get(recSYSID)) { var variables = now_GR.variables.getElements(); for (var i = 0; i < variables.length; i++) { var question = variables[i].getQuestion(); if (!gs.nil(question)&&question!=''){ gs.info('VARIABLE NAME:' + question.getLabel() + ", VARIABLE VALUE:" + question.getValue()); } } } } function getVarsComplex(recSYSID, table) { var producerVars_allVars = new GlideRecord('question_answer'); producerVars_allVars.addQuery('table_sys_id', recSYSID); //producerVars_allVars.addQuery('question.ty...
All things ServiceNow... take a look at my channel: https://www.youtube.com/@cloudminus89