---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideTableHierarchy - Scoped

# GlideTableHierarchy - Scoped {#ariaid-title1}

The GlideTableHierarchy API provides methods for handling information about table relationships.

## GlideTableHierarchy - GlideTableHierarchy(String tableName) {#ariaid-title2}

Instantiates a GlideTableHierarchy object.
{#r_ScopedGlideTableHierarchyGlideTableHierarchy_String__table_fff_zrs_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | The name of the table. |
[Table 1. Parameters]

{#r_ScopedGlideTableHierarchyGlideTableHierarchy_String__table_fff_zrs_2r}  

    var table = new GlideTableHierarchy("incident"); 
    gs.info(table.getTables());

Output:

    incident,task

## GlideTableHierarchy - getAllExtensions() {#ariaid-title3}

Returns an array of strings containing all tables that extend the current table and
includes the current table.
{#r_ScopedGlideTableHierarchyGetAllExtensions__table_ctl_fvs_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 2. Parameters]

{#r_ScopedGlideTableHierarchyGetAllExtensions__table_ctl_fvs_2r} {#r_ScopedGlideTableHierarchyGetAllExtensions__table_dtl_fvs_2r__entry__2}

| Type | Description |
|-|-|
| Array | An array of strings containing the tables in the hierarchy that includes the current table. |
[Table 3. Returns]

{#r_ScopedGlideTableHierarchyGetAllExtensions__table_dtl_fvs_2r}  

    var table = new GlideTableHierarchy("task"); 
    gs.info(table.getAllExtensions());

Output: Line breaks added for clarity.

    task,sc_task,problem_task,change_phase,sc_req_item,kb_submission,
    release_phase,problem,ticket,sm_task,hr_task,change_task,change_request,
    change_request_imac,incident,release_task,vtb_task,sm_order,hr_case,
    sysapproval_group,sc_request

## GlideTableHierarchy - getBase() {#ariaid-title4}

Returns the parent class.
{#r_ScopedGlideTableHierarchyGetBase__table_aqs_p3t_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 4. Parameters]

{#r_ScopedGlideTableHierarchyGetBase__table_aqs_p3t_2r} {#r_ScopedGlideTableHierarchyGetBase__table_bqs_p3t_2r__entry__2}

| Type | Description |
|-|-|
| String | The parent class. |
[Table 5. Returns]

{#r_ScopedGlideTableHierarchyGetBase__table_bqs_p3t_2r}  

    var table = new GlideTableHierarchy("cmdb_ci_server"); 
    gs.info(table.getBase());

Output:

    cmdb_ci_computer

## GlideTableHierarchy - getHierarchy() {#ariaid-title5}

Returns an array of strings containing all classes in the hierarchy of the current
table.
{#r_ScopedGlideTableHierarchyGetHierarchy__table_kwh_sht_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| none |   |   |
[Table 6. Parameters]

{#r_ScopedGlideTableHierarchyGetHierarchy__table_kwh_sht_2r} {#r_ScopedGlideTableHierarchyGetHierarchy__table_lwh_sht_2r__entry__2}

| Type | Description |
|-|-|
| Array | An array of strings of the classes in the hierarchy. |
[Table 7. Returns]

{#r_ScopedGlideTableHierarchyGetHierarchy__table_lwh_sht_2r}  

    var table = new GlideTableHierarchy("incident"); 
    gs.info(table.getHierarchy());

Output:

    incident,task

## GlideTableHierarchy - getName() {#ariaid-title6}

Returns the table's name.
{#r_ScopedGlideTableHierarchyGetName__table_hqw_hts_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 8. Parameters]

{#r_ScopedGlideTableHierarchyGetName__table_hqw_hts_2r} {#r_ScopedGlideTableHierarchyGetName__table_iqw_hts_2r__entry__2}

| Type | Description |
|-|-|
| String | The table's name. |
[Table 9. Returns]

{#r_ScopedGlideTableHierarchyGetName__table_iqw_hts_2r}  

    var table = new GlideTableHierarchy("incident"); 
    gs.info(table.getName());

Output:

    incident

## GlideTableHierarchy - getRoot() {#ariaid-title7}

Returns the top level class in the hierarchy.
{#r_ScopedGlideTableHierarchyGetRoot__table_xnc_f3t_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 10. Parameters]

{#r_ScopedGlideTableHierarchyGetRoot__table_xnc_f3t_2r} {#r_ScopedGlideTableHierarchyGetRoot__table_ync_f3t_2r__entry__2}

| Type | Description |
|-|-|
| String | Name of the root class. |
[Table 11. Returns]

{#r_ScopedGlideTableHierarchyGetRoot__table_ync_f3t_2r}  

    var table = new GlideTableHierarchy("cmdb_ci_server"); 
    gs.info(table.getRoot());

Output:

    cmdb

## GlideTableHierarchy - getTables() {#ariaid-title8}

Returns an array of strings of the table names in the hierarchy.
{#r_ScopedGlideTableHierarchyGetTables__table_xkr_xts_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 12. Parameters]

{#r_ScopedGlideTableHierarchyGetTables__table_xkr_xts_2r} {#r_ScopedGlideTableHierarchyGetTables__table_ykr_xts_2r__entry__2}

| Type | Description |
|-|-|
| Array | An array of strings containing the names of tables in the hierarchy. |
[Table 13. Returns]

{#r_ScopedGlideTableHierarchyGetTables__table_ykr_xts_2r}  

    var table = new GlideTableHierarchy("incident"); 
    gs.info(table.getTables());

Output:

    incident,task

## GlideTableHierarchy - getTableExtensions() {#ariaid-title9}

Returns an array of strings containing all tables that extend the current
table.
{#r_ScopedGlideTableHierarchyGetTableExtensions__table_egs_p5s_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 14. Parameters]

{#r_ScopedGlideTableHierarchyGetTableExtensions__table_egs_p5s_2r} {#r_ScopedGlideTableHierarchyGetTableExtensions__table_fgs_p5s_2r__entry__2}

| Type | Description |
|-|-|
| Array | An array of strings containing the tables that extend the current table. |
[Table 15. Returns]

{#r_ScopedGlideTableHierarchyGetTableExtensions__table_fgs_p5s_2r}  

    var table = new GlideTableHierarchy("task"); 
    gs.info(table.getTableExtensions());

Output: Line breaks added for clarity

    sc_task,problem_task,change_phase,sc_req_item,kb_submission,release_phase,problem,
    ticket,sm_task,hr_task,change_task,change_request,change_request_imac,incident,
    release_task,vtb_task,sm_order,hr_case,sysapproval_group,sc_request

## GlideTableHierarchy - isBaseClass() {#ariaid-title10}

Returns true if this is a base class.
{#r_ScopedGlideTableHierarchyIsBaseClass__table_js2_1jt_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 16. Parameters]

{#r_ScopedGlideTableHierarchyIsBaseClass__table_js2_1jt_2r} {#r_ScopedGlideTableHierarchyIsBaseClass__table_ks2_1jt_2r__entry__2}

| Type | Description |
|-|-|
| Boolean | True if the current table has no parent and has extensions. |
[Table 17. Returns]

{#r_ScopedGlideTableHierarchyIsBaseClass__table_ks2_1jt_2r}  

    var table = new GlideTableHierarchy("incident"); 
    gs.info(table.isBaseClass());

Output:

    false

## GlideTableHierarchy - isSoloClass() {#ariaid-title11}

Returns true if this table is not in a hierarchy.
{#r_ScopedGlideTableHierarchyIsSoloClass__table_djg_mjt_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 18. Parameters]

{#r_ScopedGlideTableHierarchyIsSoloClass__table_djg_mjt_2r} {#r_ScopedGlideTableHierarchyIsSoloClass__table_ejg_mjt_2r__entry__2}

| Type | Description |
|-|-|
| Boolean | True if the current table has no parent and no extensions. |
[Table 19. Returns]

{#r_ScopedGlideTableHierarchyIsSoloClass__table_ejg_mjt_2r}  

    var table = new GlideTableHierarchy("sys_user"); 
    gs.info(table.isSoloClass());

Output:

    true

## GlideTableHierarchy - hasExtensions() {#ariaid-title12}

Returns true of this class has been extended.
{#r_ScopedGlideTableHierarchyHasExtensions__table_jqs_wjt_2r__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 20. Parameters]

{#r_ScopedGlideTableHierarchyHasExtensions__table_jqs_wjt_2r} {#r_ScopedGlideTableHierarchyHasExtensions__table_kqs_wjt_2r__entry__2}

| Type | Description |
|-|-|
| Boolean | True if the current table has extensions. |
[Table 21. Returns]

{#r_ScopedGlideTableHierarchyHasExtensions__table_kqs_wjt_2r}  

    var table = new GlideTableHierarchy("incident"); 
    gs.info(table.hasExtensions());

Output:

    false


