Announcing the Global SNUG Board of Directors. Learn more here

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Thomas_Davis
Administrator
Administrator

Customize Column Headers in Database View Results

So maybe you had to create a database view or you had to generate some reporting from a database view that was created by someone else. Regardless of the situation, we all have been in a situation where perhaps the data being displayed could be better represented. Column headers are an important factor in understanding what you are looking at. If you have ever wanted to change and make a column header more descriptive, then this is the Blog for you.

In this blog, we are going to show you how you can create Labels(column header), build Relationships to present a Related List on a form, and update a database view with better column headers in the results.

find_real_file.png

We have all seen something like this below and then a conversation like below, follows:

"What is String value, why are there three of them? Could you change the column header to be more descriptive, easier to understand what we are looking at?"

There are plenty of examples that we can think of where we needed to change the column header to something that either looked better or made more sense.

find_real_file.png

How do you do it? 

The secret to relabeling the fields in a database view is to take advantage of the Field Label functionality. We can create a Field Label directly against the Documentation [sys_documentation] table and we can create a relationship between the Database View [sys_db_view] table and the Field Label [sys_documentation] table, utilizing the Relationship functionality.

  • You will need the personalize_dictionary or admin role to create a Field Label on the [sys_documention] table.
  • You will need the admin role to create a Relationship
  • The admin role is needed to create or edit a Database view.
Label creation on the Documentation Table
 
Follow the directions below to create a Label on the Documentation [sys_documentation] table, below is a video showing the steps. **Understand, you may not have the same database view set up, but these steps will work with your database view.**
  1. In the Filter Navigator, type in sys_documentation.list
  2. Click New
  3. Table: Service Desk Survey Normalization
    **This is the database view**
  4. Label: Response Time Satisfaction
    **This is what you want the label to display as the column header**
  5. Element: quest3_string_value
    **This will be the column in the database view that you are creating a label for**
  6. Hint: How satisfied were you with the response time to your incident?
    **This is the actual value that is being called in the view, this will display on hover over**
  7. Click Submit
 
Field Label Relationship creation
 
Relationships let us add related lists even if the tables do not have a direct reference. Follow the steps below to create a Field Label Relationship, below is a video showing the steps. 
  1. Search for System Definitions > Relationships in the Filter Navigator
  2. Click New
  3. Name: Field Labels
  4. In the dropdown for Applies to table, select Database view [sys_db_view]
  5. In the Queries from table, select Documentation [sys_documentation]
  6. In the Query with, apply this line of code:

    current.addQuery('name', parent.getValue('name'));

  7. Click Submit

References:

Configuring the form layout
Creating a Relationship

Now that we have created a Documentation label and also created a Relationship that will give us a Related List on our database form, let's go to our database view and see what has happened.

  1. Search for Database view in the Filter Navigator
  2. Select your database view and open it
  3. Notice that our Field Label related list is not on the form
  4. We need to add it, right-click on the top gray banner and select Configure > Related List
  5. Select Field Labels in the Available list and move it over to Selected
  6. Click Save

Notice that we have a new tab called Field Labels. We should also see the Label that we created earlier directly on the Documentation table, already there.

 
Let's add a couple more Field Labels to our Database view. Follow the steps below and you can also see them in the video provided.

Go into your Database view and click on the Field Labels tab:

  1. Click New
  2. Name: Technical Competency
    **We are giving our a label a condensed name base doff of the question be asked in the survey we are referencing in our database view. You can, of course, make it as long as you would like, but condensing if long is recommended.**
  3. Plural: Technical Competency s
  4. Element: quest2_string_value
    **This is what you want the label to display as the column header**
  5. Hint: Question: Please rate the technical competency of the technician serving you
    **This is the actual value that is being called in the view, this will display on hover over**
 

 Follow the above steps again and add one more Field Lable to the Database view:

  1. Click New
  2. Name: First Call Resolution 
    **We are giving our a label a condensed name base doff of the question be asked in the survey we are referencing in our database view. You can, of course, make it as long as you would like, but condensing if long is recommended.**
  3. Plural: First Call Resolutions
  4. Element: quest1_string_value 
    **This is what you want the label to display as the column header**
  5. Hint: Question: Was technician able to resolve your issue during the first call?
    **This is the actual value that is being called in the view, this will display on hover over**
You can continue to add more columns to build the Database view results in a way that will best suit your Use Case. Remember to add Hints if you plan on condensing the Label.find_real_file.png
 
If we click Try It, we will see the results of the Database view, however, we will not see the Field Labels that we just added. So, we need to Update Personalized List for the Database view and add in the columns that we need. You can add whatever columns are needed for your Use Case. The video below will show the steps to add the columns.
 
 
Now that you have the Database view the way you need it, you can begin to build Performance Analytics or Reporting off of it.
 
References:

Database Views:

Documentation/Relationship/Related Lists:

 
Conclusion: When using a Database view, utilize the tools within the Platform to enhance the user experience. Create column labels that drive understanding of what is being presented. Labels can clearly define the data that is being presented.
2 Comments