The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Can't relabel a column in a database view

scotty81
Kilo Contributor

Hi,

   

I'm having difficulty in being able to rename 2 columns that appear in a database view.   Here's a simple example.   I created as shown below, which is merely a join of the incident and problem tables.   I'm just using this simple example here - what I need to do is more complex.

 

find_real_file.png

If you create a report that simply shows a list view of several of the columns, and want to see both the Incident number and Problem number (if one exists), you will find that both columns are labeled number, which comes from their respective tables.

 

So, I followed the directions in this article in the Wiki (Step 2.3.1): http://wiki.servicenow.com/index.php?title=Database_Views

  The instructions say to create an entry in the Language File which I did as follows.  


Table: u_incident_and_problem (the name of my DB view)  

Label: this is a test

Plural: left blank

Element: problem_id


However, I get an error when I enter the above.   So, I must be doing something wrong, but I'm not sure what the correct way to fix this entry is.

 

Thanks in advance.

Scotty  

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

element name should be given like



viewtableprefix_fieldname



EX : ctask_closed_at




ctack is view table prefix and closed_at is view field


View solution in original post

14 REPLIES 14

not sure and never tried it ... can you try changing the dot in the element name to a underscore '_' ???


I tried that as well, it dint


sorry .. dont have a clue


Hi Vibha and Kalai,



Actually, I have a need to do the exact thing that Vibha asked for.   And, that is relabeling a column (in a database view) that is a field that is referenced in another table.   I've tried multiple ways to do that and can't find any way that works.



So, in the example in my original table join (where I join Incident and Problem), I am joining records where problem_id field of the Incident Table joins with the sys_id field of the Problem table.   That join works flawlessly.   If I create a report from that database view, I see that I can get to the Problem record 2 different ways:


From the Incident table via the Problem.Number field or


from the Problem table via the Number(p_number) field



If you create a report and select both of these fields to be shown, you will see that they are both labeled: Number, which is not very descriptive.   So, if you attempt to make a new Language Definition File to re-label one of the columns, that is where things fall apart.   For the element name, I've tried various combinations and either they are invalid entries or the entries are OK, but the columns don't get relabeled.   It DOES work when I attempt to rename a simple field, but not when the column I'm trying to re-label is a reference into another table.



Is there anyone at Service Now who might have any insight into how to do this?



Thanks,


Scotty81


The only way that I've gotten this to work is to bring the dot-walked field into the database view by joining that fields table and then create a language file entry for the field.   Its cumbersome and the joining of the third table is unnecessary given the dot-walking, but its the only way to get the label correct.