Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Update field on reference field table with business rule

Sam Motley
Giga Guru

Hi, 

 

I'm trying to update a field in another table using a reference field dot walking based on a condition on the original table. 

 

I have a custom true / false field on our cmdb_ci_computer table 

In the software installation table i'm looking for a particular software using display name and if it exists using the installed on field i'm trying to update the true/false field. 

 

i have tried business rules and workflow it looks like it's running but for whatever  reason the true/false field will not update. 

 

I've tried this method before and it's worked - does anyone know if there is something stopping the field updating on / from the software installation table? 

 

Cheers, 

1 ACCEPTED SOLUTION

Sid_Takali
Kilo Patron

Hi @Sam Motley Share your code which you tried and try below code

if (current.software.display_name == 'YourSoftwareName') {
    var computerGr = new GlideRecord('cmdb_ci_computer');
    if (computerGr.get(current.installed_on)) {
        computerGr.your_true_false_field = true; // or false depending on your logic
        computerGr.update();
    }
}

 

View solution in original post

5 REPLIES 5

Hey Brad, i believe it was linked to using the actions tab to update the dot walked field - didn't seem to take it into account - i ended up using the above script cheers