Lookup Select Box saving text value rather than sys_id from a record producer

rathbone
Tera Contributor

When changing a record producer field that is a reference to a Lookup Select Box the html it generates sets the options value attribute to the String value not the sys_id.   When the request is saved to my table the reference is then broken.   I can't seem to find anywhere I can tell the field to populate the sys_id instead of string value.   How do I set the Lookup Select Box to have the sys_id in the value instead of the string value?   I am running Eureka but have tried in Fuji on my personal instance with the same result.   If I leave it as just a reference field it works as expected.

RecordProducer.PNGRecordProducerSource.PNG

1 ACCEPTED SOLUTION

HV1
Mega Guru

What field from the referenced table have you set as the Lookup Value field.   The Lookup Value field should be the sys_id of the referenced table in this case.


Reference: Variable Types - ServiceNow Wiki



- Hardik Vora


View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Stanley,



You have to update the value via script through record producer. That is fetch the variable at record producer and then GlideRecord the target table to get the sys_id.


Please let me know if you have any questions.


HV1
Mega Guru

What field from the referenced table have you set as the Lookup Value field.   The Lookup Value field should be the sys_id of the referenced table in this case.


Reference: Variable Types - ServiceNow Wiki



- Hardik Vora


rathbone
Tera Contributor

Thank you.   I had set the Lookup value field as the name field of the referenced table instead of the sys_id.   Didn't notice the "Lookup label field(s)" option.   Thank you very much.   Works now.


Het
Kilo Explorer

Set lookup value field as "SYS_ID"

and lookup lable field as a text display in select box.

find_real_file.png

The select box display as follows.Ip_address is text display and sys_id is value.

find_real_file.png