Skip to main content

Posts

Showing posts from January, 2021

Transform map: bulk update groups and group memberships

- drop the current group members - repopulate the group members - update the group (e.g. group manager) import sheet format: , delimited list of users (email) transform map scripts //--prevent insert onstart : var grGrps = new GlideRecord ( 'sys_user_group' ); grGrps . query (); log . info ( 'onStart:TrMap:BulkUpdateCCGrps:: sys_user_group count= ' + grGrps . getRowCount ()); var grGrpMems = new GlideRecord ( 'sys_user_grmember' ); grGrpMems . query (); log . info ( 'onStart:TrMap:BulkUpdateCCGrps:: sys_user_grmember= ' + grGrpMems . getRowCount ()); oncomplete : //--record the final counts var IS = source . sys_import_set . getDisplayValue (); var grGrps = new GlideRecord ( 'sys_user_group' ); grGrps . query (); log . info ( IS + ' - onComplete:TrMap:BulkUpdateCCGrps:: sys_user_group count= ' + grGrps . getRowCount ()); var grGrpMems = new GlideRecord ( &#

ServiceNow Service catalog lookup select: pull cat item sys id into reference qualifier, use data lookup definitions

ServiceNow Service catalog lookup select: pull cat item sys id into reference qualifier, use data lookup definitions Service catalog dl: https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-management/concept/c_ServiceCatalogDataLookup.html   extending system dl table so as not to incur license cost: https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/field-administration/reference/r_CreateCustomDataLookups.html this variable does a lookup to a table extending the DL tables to perform a data lookup to pull in a value named “catalogue UID” based on the “request type” variable: Data lookup table (extends DL table) variable javascript : 'active=true^u_catalogue_item=' + current . cat_item . sys_id ;   Corresponding variables populated via data lookup definitions Catalog client script on the request type to populate item request type> which in turn fires the data lookup definition: function onChang

Push end user out of portal view: load a page and its widgets without the portal look at feel

 this is the format for any portal page+widgets, using sp.do. Case in point, surveys https://<instance>.service-now.com/ $sp.do ?id=take_survey&instance_id=83270d33db61e0101beb298a489619d6 other example, loads the page and widget outside of portal frame: https://<instance>.service-now.com/ $sp.do ?id=sc_category&sys_id=0ebdf489db07cf0046cc72dabf96xxxx

clearing all email logs in a sub prod instance

 discussed here: community --- var instURL = gs . getProperty ( 'glide.servlet.uri' ); if ( instURL . indexOf ( 'https://PRODINSTANCE.service-now.com' )>- 1 ) { gs . print ( 'do not run on prod' ); } else { var grEmails = new GlideRecord ( 'sys_email' ); grEmails . addQuery ( 'type' , 'send-ready' ); grEmails . setValue ( 'type' , 'send-ignored' ); grEmails . updateMultiple (); }