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.

App Engine Table Question

Brian Sorensen
Giga Guru

I have a custom table with a simple App we have called New Hires

On the table I have a field called Position ID

In here our team enters the Position ID tied to a new hire.

 

On my ALM_hardware table I have a similar field, what I want to do is have the Workday Position ID column look at the record in in the ALM_table and post the model of computer we have for that role.

 

BrianSorensen_0-1702948891727.png

 

Above is the example of the App Engine table

This is the properties

BrianSorensen_1-1702949020396.png

 

 

Any idea how I configure this?

 

Essentially if someone enters the ID P017254, the Available asset would return the Model value below

BrianSorensen_2-1702949144117.png

Assuming there is something in here I need to code?

 

BrianSorensen_3-1702949203914.png

 

7 REPLIES 7

I think this is right, but maybe I missed a step?
We are going to go with Display Name in the field for the asset
here is what I have

 

System > Business Rule

BrianSorensen_0-1702990387183.png

BrianSorensen_1-1702990430751.png

(function executeRule(current, previous /*null when async*/) {

// Add your code here
var gr = new GlideRecord("alm_hardware");
gr.addQuery("MLSE Position ID", current.workday_position_id);
gr.query();
if (gr.next()) {
current.available_asset = gr.display_name;
}
})(current, previous);
 
When I look at the table I see this
BrianSorensen_2-1702990549878.png

 

 

I know a few don't have an asset, but P529090 does

 

I'll recheck for typos

Hi @Brian Sorensen ,

 

U wish to populate model display name correct?

 

if yes then do something like this

current.available_asset = gr.model.getDisplayValue();

 

Thanks,

Danish

 

Yes that is what I want to do.

So if I add your line in replace of 

current.available_asset = gr.display_name;

?

 

Will try