---
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


---

# GlideURI - Global

# GlideURI - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read

The GlideURI API provides methods to handle URI parameters in a global application.  
Note:  
Do not use the GlideURI API in scripts that are executed during export or in background jobs.  
For more information on using URIs:

* [Navigate by URL](https://www.servicenow.com/docs/access?context=navigate-using-url&version=xanadu&pubname=xanadu-platform-user-interface&ft:locale=en-US)
* [Navigation stack](https://www.servicenow.com/docs/access?context=c_NavigationStack&version=xanadu&pubname=xanadu-platform-user-interface&ft:locale=en-US)
{#GlideURIGlobalAPI__ul_swn_bjb_rmb}

See also [Action - getGlideURI()](https://servicenow-prod.fluidtopics.net/q_Qm3xe0DXH0V7EjWRcGOA#Action_getGlideURI "Gets a GlideURI object to determine the user view.").

## GlideURI - deleteMatchingParameter(String match) {#ariaid-title2}

Deletes one or more parameters from the URI that match the beginning of the provided
string.
{#GlideURI_deleteMatchingParameter_S__table_vh4_ftg_rmb__entry__3}

| Name | Type | Description |
|-|-|-|
| match | String | Partial name of one or more parameters to remove from the query portion of a URI. |
[Table 1. Parameters]

{#GlideURI_deleteMatchingParameter_S__table_vh4_ftg_rmb} {#GlideURI_deleteMatchingParameter_S__table_wh4_ftg_rmb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 2. Returns]

{#GlideURI_deleteMatchingParameter_S__table_wh4_ftg_rmb}  
The following example shows how to delete URI parameters that partially match the name
provided.

    // create the GlideURI object
    var uri = action.getGlideURI();

    uri.deleteMatchingParameter('sysparm_list_');
    uri.deleteMatchingParameter('sysparm_record_');

### Scoped equivalent {#GlideURI_deleteMatchingParameter_S__section_bct_nbs_mcb}

This method is not available in scoped applications.

## GlideURI - deleteParameter(String name) {#ariaid-title3}

Removes a specified parameter from the query portion of the URI.
{#GlideURI_deleteParameter_S__table_vh4_ftg_rmb__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Name of the parameter to remove from the query portion of a URI. |
[Table 3. Parameters]

{#GlideURI_deleteParameter_S__table_vh4_ftg_rmb} {#GlideURI_deleteParameter_S__table_wh4_ftg_rmb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 4. Returns]

{#GlideURI_deleteParameter_S__table_wh4_ftg_rmb}  
The following example shows how to delete a URI parameter.

    // create the GlideURI object
    var uri = action.getGlideURI(); 

    uri.deleteParameter('sysparm_referring_url');

### Scoped equivalent {#GlideURI_deleteParameter_S__section_bct_nbs_mcb}

This method is not available in scoped applications.

## GlideURI - get(String name) {#ariaid-title4}

Returns the value of the specified parameter.
{#GlideURI_get_S__table_bff_yp3_ks__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The parameter name. |
[Table 5. Parameters]

{#GlideURI_get_S__table_bff_yp3_ks} {#GlideURI_get_S__table_cff_yp3_ks__entry__2}

| Type | Description |
|-|-|
| String | The value for the specified parameter. |
[Table 6. Returns]

{#GlideURI_get_S__table_cff_yp3_ks}  

    // create the GlideURI object
    var uri = action.getGlideURI();
    uri.set('sysparm_query', 'priority=2^active=true' );
    var fileString = uri.get('sysparm_query');
    gs.info(fileString);

Output:

    priority=2^active=true

### Scoped equivalent {#GlideURI_get_S__section_q2n_wgs_mcb}

To use the get() method in a scoped application, use the corresponding
scoped method: [GlideURI - get(String name)](https://servicenow-prod.fluidtopics.net/7WZ8W4hOiMVJV1Lgu_Q6Kg#r_ScopedGlideURIGet_String "Returns the value of the specified parameter.")
.

## GlideURI - getFileFromPath() {#ariaid-title5}

Returns the file name portion of the URI.
{#GlideURI_getFileFromPath__table_nzz_gs3_ks__entry__3}

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

{#GlideURI_getFileFromPath__table_nzz_gs3_ks} {#GlideURI_getFileFromPath__table_ozz_gs3_ks__entry__2}

| Type | Description |
|-|-|
| String | The file name portion of the URI. |
[Table 8. Returns]

{#GlideURI_getFileFromPath__table_ozz_gs3_ks}  

    var gURI = action.getGlideURI();
            
    var fileString = gURI.getFileFromPath();
    gs.info(fileString);

### Scoped equivalent {#GlideURI_getFileFromPath__section_q2n_wgs_mcb}

To use the getFileFromPath() method in a scoped application, use the
corresponding scoped method: [GlideURI - getFileFromPath()](https://servicenow-prod.fluidtopics.net/7WZ8W4hOiMVJV1Lgu_Q6Kg#r_ScopedGlideURIGetFileFromPath "Returns the file name portion of the URI.")
.

## GlideURI - getMap() {#ariaid-title6}

Returns a map (key value pairs) containing each parameter in the query and its
associated value.
{#GlideURI_getMap__table_g2b_b5g_rmb__entry__3}

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

{#GlideURI_getMap__table_g2b_b5g_rmb} {#GlideURI_getMap__table_h2b_b5g_rmb__entry__2}

| Type | Description |
|-|-|
| Object |   |
[Table 10. Returns]

{#GlideURI_getMap__table_h2b_b5g_rmb}  
The following example shows how to get `sysparm_query` parameters. See also [Action - getGlideURI()](https://servicenow-prod.fluidtopics.net/q_Qm3xe0DXH0V7EjWRcGOA#Action_getGlideURI "Gets a GlideURI object to determine the user view.") .

    gs.action.getGlideURI().getMap().get('sysparm_query');

### Scoped equivalent {#GlideURI_getMap__section_bct_nbs_mcb}

This method is not available in scoped applications.

## GlideURI - set(String name, String value) {#ariaid-title7}

Sets the specified parameter to the specified value.
{#GlideURI_set_S_S__table_z2w_tq3_ks__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The parameter name. |
| value | String | The value. |
[Table 11. Parameters]

{#GlideURI_set_S_S__table_z2w_tq3_ks} {#GlideURI_set_S_S__table_afw_tq3_ks__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 12. Returns]

{#GlideURI_set_S_S__table_afw_tq3_ks}  
The following example shows how to set value of a sysparm_query field. See also [Action - getGlideURI()](https://servicenow-prod.fluidtopics.net/q_Qm3xe0DXH0V7EjWRcGOA#Action_getGlideURI "Gets a GlideURI object to determine the user view.") .

    var gURI = action.getGlideURI();
    gURI.set('sysparm_query', 'priority=2^active=true' );
    var fileString = gURI.get('sysparm_query');
    gs.info(fileString);

Output:

    priority=2^active=true

### Scoped equivalent {#GlideURI_set_S_S__section_q2n_wgs_mcb}

To use the set() method in a scoped application, use the corresponding
scoped method: [GlideURI - set(String name, String
value)](https://servicenow-prod.fluidtopics.net/7WZ8W4hOiMVJV1Lgu_Q6Kg#r_ScopedGlideURISet_String_String "Sets the specified parameter to the specified value.")
.

## GlideURI - setView(String view) {#ariaid-title8}

Adds the sysparm_view parameter to the query with the named
view.
A view defines the elements that appear when a user opens a form or a list. The
sysparm_view parameter specifies the view to be used for a list or a
form. For more information on views, see [View management](https://www.servicenow.com/docs/access?context=view-management-overview&version=xanadu&pubname=xanadu-platform-user-interface&ft:locale=en-US).  
See also:

* [Action - getGlideURI()](https://servicenow-prod.fluidtopics.net/q_Qm3xe0DXH0V7EjWRcGOA#Action_getGlideURI "Gets a GlideURI object to determine the user view.")
* [GlideModalV3 - switchView()](https://servicenow-prod.fluidtopics.net/991VdsfRLVSGIAiz0zj4Dw#r_GMODV3-switchView_S "Change the view and reload the modal.")
{#GlideURI_setView_S__ul_bll_frk_smb}
{#GlideURI_setView_S__table_tgr_g5g_rmb__entry__3}

| Name | Type | Description |
|-|-|-|
| view | String | Name of the sysparm_view parameter to set in the URI query. |
[Table 13. Parameters]

{#GlideURI_setView_S__table_tgr_g5g_rmb} {#GlideURI_setView_S__table_ugr_g5g_rmb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 14. Returns]

{#GlideURI_setView_S__table_ugr_g5g_rmb}  
The following example shows how to add the major incidents view to the URI query in the
Incidents \[incident\] table. For example, `sysparm_view=Major%20Incidents`.
See also [Action - getGlideURI()](https://servicenow-prod.fluidtopics.net/q_Qm3xe0DXH0V7EjWRcGOA#Action_getGlideURI "Gets a GlideURI object to determine the user view.") .

    // create the GlideURI object
    var uri = action.getGlideURI(); 

    // Adds the Major incidents to the query
    uri.setView('Major Incidents');

    // https://instance.service-now.com/incident.do?sys_id=0&sysparm_view=Major%20Incidents ...

### Scoped equivalent {#GlideURI_setView_S__section_bct_nbs_mcb}

This method is not available in scoped applications.

## GlideURI - toString(String path) {#ariaid-title9}

Reconstructs the URI string and performs the proper URL encoding by converting non-valid characters to their URL code. For example, converting \& to '%26'.
Parameters set with the set()
method are encoded with the URI as well.
{#GlideURI_toString_S__table_zjw_4r3_ks__entry__3}

| Name | Type | Description |
|-|-|-|
| path | String | The base portion of the system URL to which the URI is appended. |
[Table 15. Parameters]

{#GlideURI_toString_S__table_zjw_4r3_ks} {#GlideURI_toString_S__table_akw_4r3_ks__entry__2}

| Type | Description |
|-|-|
| String | The URL. |
[Table 16. Returns]

{#GlideURI_toString_S__table_akw_4r3_ks}  
The following examples shows how to convert invalid characters to URL code in an instance
URL. See also [Action - getGlideURI()](https://servicenow-prod.fluidtopics.net/q_Qm3xe0DXH0V7EjWRcGOA#Action_getGlideURI "Gets a GlideURI object to determine the user view.") .

    var gURI = action.getGlideURI();
    fileString = gURI.toString('https://<your instance>.service-now.com/navpage.do');

### Scoped equivalent {#GlideURI_toString_S__section_q2n_wgs_mcb}

To use the toString() method in a scoped application, use the
corresponding scoped method: [GlideURI - toString(String
path)](https://servicenow-prod.fluidtopics.net/7WZ8W4hOiMVJV1Lgu_Q6Kg#r_ScopedGlideURIToString_String "Reconstructs the URI string and performs the proper URL encoding by converting non-valid characters to their URL code. For example, converting & to '%26'.")
.

