Easy way to create a List report and include the sys_id

srphayre
Giga Contributor

Hi all,

I'm trying to create a simple List report on cmdb_ci_server with about 10 fields but want the report to include the record's sys_id (the report will probably be updated offline and I want a clear way to track back to the correct record).

I know I could create a database view to accomplish this but wondered if there was an easier way.

Still using Berlin.
Streve

10 REPLIES 10

One other relatively easy way to accomplish this is to create a single-table database view using the table where you need to show the sys_id. A table included in a database view exposes the sys_id as a regular column that can be added as a report column, etc.


Mark and Geoff. Thanks for both of your solutions. It's great to learn from your experience. Much appreciated, and I didn't even as the original question.


bswisshelm
Kilo Contributor

I did the following:

Added a new string field: sys_id_display
Edited the dictionary value for the new field.
Calculated: True
Calculation: current.sys_id

Now I can add the sys_id_display column to my list view. Seems to work great. I don't have to update any records, or worry about business rules that may not get executed.

I would think that using a calculation field would almost always be preferred over using a business rule to replicate data into a separate field. There may be a slight performance impact, but you never have to worry about data that has gotten out of sync.


I like the idea of the calculated field because it doesn't require me to go back and populate the historic values - although I wonder about the performance impact given that the sys_id will never change it seems redundant to recalculate it on every read...


CapaJC
ServiceNow Employee
ServiceNow Employee

If the table is a high activity one (lots of reads), calculated fields are the devil. But if the calculation only uses a field from the same table (which sounds like the case here), it might not be too bad.

If the calculation dot-walks through reference fields to get values from a referenced record, that's where you start seeing issues sometimes.