Bug in App Engine: Reference Fields with Column Name Starting with ref_ Does Not Store Reference

ALEX_DK
Kilo Explorer

Bug Description:

I encountered an issue in my company's instance when creating a Reference field in a table in App Engine.

If the column name of a Reference field starts with ref_, the field does not correctly capture the reference to the target table.


Steps to Reproduce:

  1. Create a new field of type Reference in a table. You can leave the reference as simple.
  2. Set the Column name to start with ref_ (e.g., ref_customer).
  3. Add the field to a form, and register a new record selecting an reference value.

Expected Behavior:

Each field should store the correct sys_id of the selected record from the referenced table.


Actual Behavior:

  • All fields with names starting with ref_ display the same sys_id when selecting a reference.
  • These fields remain empty in the database after saving.
  • Only fields not starting with ref_ store the correct reference.

Question:

Is this a known bug? Can anyone test this in their instance to confirm if this is a global issue or something specific to my company's instance?

We are currently running the Yokohama instance of servicenow.

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

I'm not sure I would call this a bug, though it is behaving like one.  In my Zurich PDI I created a couple of new reference columns on an existing table I had in a scoped app, taking app engine out of the equation.  When I create a new record on this table and populate the new reference fields they are indeed blank upon Saving or Submitting the record, and nothing looks amiss in the system logs.  If I view an/the existing record and populate the same fields with the same values, it works fine.

 

My uncertainty with calling this a bug is that ref_ is likely a reserved/system word, so best to avoid it in column names.  There's a GlideRecord notation that uses this to get fields from an extended table

https://www.servicenow.com/community/servicenow-ai-platform-articles/query-field-on-extend-table-fro... 

 

That's close enough in my book to avoid it in column names and carry on.