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

# GlideURI - Scoped {#ariaid-title1}

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

The GlideURI API provides methods to handle URI parameters in a scoped 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)
{#c_GlideURIScopedAPI__ul_swn_bjb_rmb}

See also: [GlideURI - Global](https://servicenow-prod.fluidtopics.net/F44W4HfW0NXWigj_wrJrmA#GlideURIGlobalAPI "The GlideURI API provides methods to handle URI parameters in a global application.")
.

## Scoped GlideURI - GlideURI() {#ariaid-title2}

Instantiates a GlideURI object.
{#r_ScopedGlideURIScopedGlideURI__table_hgp_t43_ks__entry__3}

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

{#r_ScopedGlideURIScopedGlideURI__table_hgp_t43_ks}

## Scoped GlideURI - get(String name) {#ariaid-title3}

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

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

{#r_ScopedGlideURIGet_String__table_bff_yp3_ks} {#r_ScopedGlideURIGet_String__table_cff_yp3_ks__entry__2}

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

{#r_ScopedGlideURIGet_String__table_cff_yp3_ks}  

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

Output:

    priority=2^active=true

## Scoped GlideURI - getFileFromPath() {#ariaid-title4}

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

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

{#r_ScopedGlideURIGetFileFromPath__table_nzz_gs3_ks} {#r_ScopedGlideURIGetFileFromPath__table_ozz_gs3_ks__entry__2}

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

{#r_ScopedGlideURIGetFileFromPath__table_ozz_gs3_ks}  

    var gURI = new GlideURI();
     
    var fileString = gURI.getFileFromPath();
    gs.info(fileString);

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

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

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

{#r_ScopedGlideURISet_String_String__table_z2w_tq3_ks} {#r_ScopedGlideURISet_String_String__table_afw_tq3_ks__entry__2}

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

{#r_ScopedGlideURISet_String_String__table_afw_tq3_ks}  

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

Output:

    priority=2^active=true

## Scoped GlideURI - toString(String path) {#ariaid-title6}

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.
{#r_ScopedGlideURIToString_String__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 8. Parameters]

{#r_ScopedGlideURIToString_String__table_zjw_4r3_ks} {#r_ScopedGlideURIToString_String__table_akw_4r3_ks__entry__2}

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

{#r_ScopedGlideURIToString_String__table_akw_4r3_ks}  

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


