Elijah Aromola
Mega Sage

I would try the following script:

function advloc() {
    var locPar;
    var userLoc = '';
    var gr = new GlideRecord('sys_user');
    gr.addQuery('sys_id', gs.getUserID());
    gr.query();
    if (gr.next()) {
        userLoc = gr.location + "";
    }

    if (userLoc.indexOf("MG") == -1) {
        locPar = "";
    } else {
        locPar = "parent=" + userLoc;
    }
    return locPar
}

This points me in the right direction, but doesn't work as an advanced reference qualifier for the variable.. I might need to rethink the way I am doing this.

Where are you calling this from? For reference qualifiers you should call a script include that returns the information you want available in the field.

I am fumbling through this so maybe a screenshot will help.find_real_file.png

You're on the right track. That script belongs in a script include that is client callable:

And in your reference qualifier you would just do:

new getLocation().locations();

View solution in original post