Lookup Utilities Functionality

Katelyn1
Kilo Expert

I've been trying to create a topic to update the street address of a user from my HR Profile User table. I manually added a user (Abraham Lincoln) because the table (sn_hr_core_profile) was empty to start. Now with the topic, I am trying to figure out how to use Lookup Utility to change their street address in the record, but I have been without luck since there is very little documentation on this functionality and the Using GlideRecords documentation seems to not be working for me. This is what I have:

find_real_file.png 

And this is the code I have for the Lookup Utility script:

(function execute(table) {
    var profile = new GlideRecord(table);
    profile.query();
    profile.addQuery('first_name', 'Abraham');
    while(profile.next()){
        profile.address = vaInputs.new_street.getValue();
        profile.update();
    }
    return profile;
})(table)
1 ACCEPTED SOLUTION
10 REPLIES 10

I also tried this.

profile.addQuery('first_name', 'CONTAINS', 'Abraham');

All of them have table defined so try doing

(function execute(table) {
    var profile = new GlideRecord('sn_hr_core_profile');
    profile.addQuery('first_name', 'Abraham');
    profile.query();
    while(profile.next()){
        profile.address = vaInputs.new_street.getValue();
        profile.update();
    }
    return profile;
})(table)

No luck 😕 

 

I don't understand why this section has the least amount of documentation and guidance/examples...

Much better, thanks!