loop through variables client side - Service Portal

 if (typeof spModal != 'undefined') {

//--loaded from Service Portal var allFields = g_form.getFieldNames(); for (var fieldName in allFields) { var fieldLabel = allFields[fieldName]; var fieldVal_p = g_form.getValue(fieldLabel).toString(); if (fieldVal_p == '' || g_form.isVisible(fieldLabel) == false) { if (fieldVal_p != 'false') { //emptyVariables.push(fieldLabel+': ' + fieldVal_p); g_form.setValue(fieldLabel, ''); } } else { //populatedVariables.push(fieldLabel+': ' + fieldVal_p); } } }

Comments

Popular posts from this blog

Running transform maps asynchronously

GlideRecord setValue

Post a command to the ECC queue for the mid server to initiate a powershell file copy