The CreatorCon Call for Content is officially open! Get started here.

Return Another Field from a Reference Variable

jmiskey
Kilo Sage

I am having a brain cramp here.  I have a variable in a Script Includes that runs against a Catalog Item that looks like this:

var st = current.variables.desired_state;

The desired_state variable on my Catalog Item is just a reference field on the sys_choice table.  So, that line of code above returns the sys_id of the record selected.  However, I do not want the sys_id of that record.  Rather, I want the value from the "value" field of that sys_choice record.  How do I return that in a variable in my Script Includes?

Thanks

1 ACCEPTED SOLUTION

venkatiyer1
Giga Guru

Hi,

 

you should be able to grab that value by using current.variables.desired_state.value as it is a reference field.

View solution in original post

3 REPLIES 3

venkatiyer1
Giga Guru

Hi,

 

you should be able to grab that value by using current.variables.desired_state.value as it is a reference field.

I was totally overthinking this!  I don't know why I was trying to make this harder than it is.

Thank you very much!

Happens. No worries.

 

Please mark the solution correct if that helped.