Skip to content

Instantly share code, notes, and snippets.

@nabil-nuvolo
nabil-nuvolo / xmlhttp payload.txt
Last active July 24, 2019 19:25
xmlhttp => Reference
sysparm_processor=Reference&sysparm_scope=global&sysparm_want_session_messages=true&ni.nolog.x_referer=ignore&x_referer=com.glideapp.servicecatalog_cat_item_view.do%3Fv%3D1%26sysparm_id%3D2b2557691b32bb009317ec217e4bcb37%26sysparm_preview%3Dtrue%26sysparm_domain_restore%3Dfalse%26sysparm_stack%3Dno&sysparm_name=IO:a90817e91b32bb009317ec217e4bcb57&sysparm_timer=98&sysparm_max=15&sysparm_chars=&sysparm_completer_id=0924f009b0400991600975e0090cb009&sys_original.IO:f5b568861b7a3f006af32fcdee4bcbb3=&IO:0e7264061b7a3f006af32fcdee4bcbe5=782cda6ddb2d574005e23ecf9d96191a&IO:469327251b72bb009317ec217e4bcbab=74c8ea3937a0d7009a5c63d2b3990e86&IO:a90817e91b32bb009317ec217e4bcb57=&sys_original.IO:a8f6e4c61b7a3f006af32fcdee4bcb63=&IO:e21953691b32bb009317ec217e4bcb9f=&sys_original.IO:e21953691b32bb009317ec217e4bcb9f=&sys_original.IO:a1676cc61b7a3f006af32fcdee4bcb23=&IO:e659dbe91b32bb009317ec217e4bcb80=&sys_original.IO:e659dbe91b32bb009317ec217e4bcb80=&IO:d6b9572d1b32bb009317ec217e4bcbed=&sys_original.IO:d6b9572d1b32bb009317ec
@nabil-nuvolo
nabil-nuvolo / createDataSource.js
Last active January 18, 2022 18:09
A series of methods that can be strung together to automate data import through Import Sets
// @param att {GlideRecord - sys_attachment}
function createDataSource(att) {
// Create new data source
var ds = new GlideRecord("sys_data_source");
ds.initialize();
ds.setValue("name", att.getValue("file_name"));
ds.setValue("import_set_table_name", "x_nuvo_eam_pi_device_import");
ds.setValue("type", "File");
ds.setValue("format", "CSV");
ds.setValue("file_retrieval_method", "Attachment");
@nabil-nuvolo
nabil-nuvolo / Refactored getWorkOrderMap.js
Last active April 27, 2019 00:02
STRY0051147_peer_review
function getWorkOrderMap(type, arr) {
var np = new x_nuvo_mobile.NuvoloProperties();
var limit = np.getProperty(
'related_work_orders_limit',
'EAM Service Portal'
);
var len = arr.length;
var woGR;
// NME: initialize display value var in hopes of finding it later
var map = {};
@nabil-nuvolo
nabil-nuvolo / STRY0048487_peer_review.js
Created March 2, 2019 17:56
Some concepts to consider when writing code
// Original & refactored with comments noting changes & reasoning
// Original
function validateSearchRequest(parent_space_id, event_start, event_end) {
var isValid = true;
var message = '';
if (!this.moment(event_start).isValid()) {
isValid = false;