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.

Reference Field Calculate Value

Kyle Cribbs
Giga Contributor

What value do I return for a Reference Fiend Calulcation?

 

Here is what I have so far;

I have a reference field to "Group"

Having this: 

(function calculatedFieldValue(current) {
	return "bbda81eddbdc1cd0ce30f1471d961996";
})(current);

Returns nothing. (that is the sys_id for a group called ISSE)

(function calculatedFieldValue(current) {
	return "ISSE";
})(current);

Returns Nothing as well.

 

Also can this return an Array of values?

6 REPLIES 6

Bharath40
Giga Guru

Can you provide more context, where is this called and what's your requirement is ? 

Imagine a reference field, that is also calculated.

The only question I am asking is, what value do I need to return?

 

Example I gave was, this is a reference to groups. I want to do some kind of logic (irrelevant) and return that group as a value.

 

So for quick testing, I am just returning the sys_id which resulted in that field having a blank value. I also tried returning the "name" which also returned a blank value. 

Kyle Cribbs
Giga Contributor

Imagine a reference field, that is also calculated.

The only question I am asking is, what value do I need to return?

 

Example I gave was, this is a reference to groups. I want to do some kind of logic (irrelevant) and return that group as a value.

 

So for quick testing, I am just returning the sys_id which resulted in that field having a blank value. I also tried returning the "name" which also returned a blank value. 

Kyle Cribbs
Giga Contributor

Bumping