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.

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

Got the same problem here.  

find_real_file.png

and once filled in I get this.  interestingly, the display Value is blank

  1. {
  2. "name": "tenant_auto_update_state",
  3. "label": "Auto Update State",
  4. "value": "Disabled",
  5. "display_value": "",
  6. "item_order": "15",
  7. "type": "18",
  8. "type_name": "Lookup Select Box",
  9. "var_order": "1600",
  10. "variable_set": "8537093fdbe2d8506a71af4bd3961956",
  11. "variable_set_name": "CE - tenant",
  12. "cat_item": "",
  13. "cat_item_name": "",
  14. "workflow": "",
  15. "workflow_name": "",
  16. "lookup_reference": "u_lookup_table",
  17. "ref_qual": "u_active=true^u_key=ce^u_lookup_id=auto_update_state^ORDERBYu_order",
  18. "ref_qual_cond": "^ORDERBYapplication",
  19. "mandatory": "false"
  20. },

tried a few variations and value is always what the label says