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.

How do we get the display value of reference cells in the multi-row variable set? i.e instead of displaying the sys_id.

PD6
Tera Contributor

How do we get the display value of reference fields in the multi-row variable set? i.e instead of displaying the sys_id.

I tried getDisplayValue() but it is giving as undefined.

 

5 REPLIES 5

Jesse_H
Mega Sage

Did you end up having any success with this?

 

I also had issues with reference fields in a multi-row variable set since it would only return the sys_id. I finally realized I could switch the variable to a Lookup Select Box, pick the table, and select specifically which field I wanted for the value and which field I wanted for the display. You also update the variable attribute so they can still search by adding 'is_searchable_choice=true'   and check the box to enable the -- none -- option by default.

....If you had some conditions on your reference variable, switch the reference qualifier to advanced real quick and copy the code. You'll put that under the ref_qualifier field when you switch it to a lookup select box.

I got part of the idea from the solution provided to this question: https://www.servicenow.com/community/developer-forum/display-3-variables-value-in-lookup-select-box-...

 

Here's an example variable:

Jesse_H_0-1731020120261.png