Reference Qualifier for Table Name field

DrewW
Mega Sage
Mega Sage

So I have been looking for a way to filter a field that has the type of "Table Name" to only show tables that are an instance of CMDB and I'm not finding a way to do it.

I tried "nameINSTANCEOFcmdb" but that did not work.

Anyone have any thoughts on this?

1 ACCEPTED SOLUTION

The system does not show the fields on the form.  I'm/was hoping that I could find a way to do it.

Right now I'm using a reference field to sys_db_object then I used the Ref Qual of "nameINSTANCEOFcmdb".  Just not a fan of how it came out.

View solution in original post

16 REPLIES 16

@Jon G1 Thanks a lot for sharing this Jon. 

Super old thread but just want to add that - if you want to also include "None" - you want to include the "Include None" attribute to be true. As this solution will default to the first table in the array.

Rick Seiden
Mega Sage

Once again, I'm super late to the party, but in case anyone else needs this...

On a table name field you can use the base_table attribute to determine the base table to start with. In this case, base_table=cmdb_ci should show the cmdb_ci table and all tables extended from it, but not any other tables.

Hi @Rick Seiden thanks for the tip, although it doesn't seem to work with table name field in combination with document id field though, I can still choose other tables inside Table Name field inside Document ID field.

Am I doing something wrong or it's generally not working in this case?

 

thanks,

Nari.

@NT I had to research this a little, and what I found is that the base_table attribute only applies to the table name field associated with the document id field, but not the document_id field itself.

If you are showing both on a form, the table name field should be limited by base_table, and document id limited by table name.  But, if you search on the document id field with the magnifying glass, however, a GlideModal form of the document_selector ui page is presented.  That ui page makes no mention of the base_table attribute, and, as you have found, you can select any table.

I don't see an easy way to update that ui page, and even if I did, I would recommend against it, as that is an out of the box ui page that may be updated in a future version of ServiceNow.

There may be an attribute you can put on the document id field to limit it, but I didn't see one either by looking on the dictionary record for a document id field, or by looking through the document_selector ui page.

If you really need this functionality, I recommend reaching out to ServiceNow's HI team to see what they have to say, as I don't see a way around the current implementation without risking issues during future upgrades.

Good luck!