---
sourceDocument: Referência da API de Yokohama
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência da API de Yokohama

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideDynamicAttribute - Global

# GlideDynamicAttribute - Global {#ariaid-title1}

* Versão de lançamento: Yokohama
* 
* Atualizado 30 de jan. de 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 7 min. de leitura

. GlideDynamicAttribute A API fornece acesso a metadados de atributo dinâmico.

Esta API fornece métodos que permitem obter valores de esquema dinâmico definidos na tabela Atributo dinâmico \[dynamic_attribute\]. Os atributos dinâmicos têm um tipo de dados definido e um sys_id. Para obter mais detalhes sobre atributos dinâmicos, consulte [Esquema dinâmico](https://www.servicenow.com/docs/access?context=dynamic-schema&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US). Os mesmos métodos também estão disponíveis para atributos dinâmicos transientes no [GlideTransientDynamicAttribute - Global](https://servicenow-prod.fluidtopics.net/uKKokTtBwtj8DIfzbM2uAQ#GlideTransientDynamicAttributeAPI ". GlideTransientDynamicAttribute A API fornece acesso a metadados de atributos dinâmicos transientes.")API.

Para usar esta API para criar atributos dinâmicos, você deve ter a função dynamic_schema_writer. Para ler dados dinâmicos usando esta API, você deve ter a função dynamic_schema_reader.  
Consulte também:

* [GlideDynamicAttributeStore - Global](https://servicenow-prod.fluidtopics.net/Lw_L7O0xu0LQZ1oB4tZc5Q#GlideDynamicAttStoreAPI ". GlideDynamicAttributeStore A API fornece acesso a um tipo de dados de armazenamento de atributos dinâmicos, semelhante a outros tipos de dados, como cadeia de caracteres, data ou data/hora.")
* [GlideElementDynamicAttributeStore - Global](https://servicenow-prod.fluidtopics.net/W30Sm753mG_CEhmeHopRwA#GlideElementDynamicAttStoreAPI ". GlideElementDynamicAttributeStore A API fornece métodos de script convenientes para gerenciar atributos dinâmicos no registro atual do Glide. Use estes métodos em conjunto com GlideRecord API para obter e definir valores de atributo dinâmico definidos.")
{#GlideDynamicAttributeAPI__ul_dvm_lym_b2c}

## GlideDynamicAttribute - getGroupName() {#ariaid-title2}

Obtém o valor da propriedade nome do grupo de um objeto de atributo dinâmico.
{#GDA-getGroupName__table_n5y_sln_b2c__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 1. Parâmetros]

{#GDA-getGroupName__table_n5y_sln_b2c} {#GDA-getGroupName__table_o5y_sln_b2c__entry__2}

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | Valor da propriedade Nome do grupo do atributo dinâmico. Consulte também [Create a dynamic attribute group](https://www.servicenow.com/docs/access?context=create-dynamic-attribute-group&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US). |
[Tabela 2. Retorna]

{#GDA-getGroupName__table_o5y_sln_b2c}  
No exemplo a seguir, o valor do nome do grupo de objetos de atributo dinâmico é exibido como r .

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue('a->b', 5);    // transient (adding here)
    das.setDynamicAttributeValue('a->c', 10);   // defined in dynamic_attribute table

    var attributes = das.getDynamicAttributes();
    gs.info(attributes);

    for (var i = 0; i < attributes.length; i++) {
        var attr = attributes[i];
    	
        gs.info("");
        gs.info("[" + i + "].getPath()      = " + attr.getPath());
        gs.info("[" + i + "].getName()      = " + attr.getName());
        gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
        gs.info("[" + i + "].getSysId()     = " + attr.getSysId());
        gs.info("[" + i + "].isTransient()  = " + attr.isTransient());
        gs.info("[" + i + "].getType()      = " + attr.getType());
    }

Saída:

    *** Script: a->c,a->b
    *** Script: 
    *** Script: [0].getPath()      = a->c
    *** Script: [0].getName()      = c
    *** Script: [0].getGroupName() = a
    *** Script: [0].getSysId()     = 8bc411a94fc01210b8ddc0e552ce0b3c
    *** Script: [0].isTransient()  = false
    *** Script: [0].getType()      = integer
    *** Script: 
    *** Script: [1].getPath()      = a->b
    *** Script: [1].getName()      = b
    *** Script: [1].getGroupName() = a
    *** Script: [1].getSysId()     = undefined
    *** Script: [1].isTransient()  = true
    *** Script: [1].getType()      = string

## GlideDynamicAttribute - getName() {#ariaid-title3}

Obtém o valor da propriedade name de um objeto de atributo dinâmico.
{#GDA-getName__table_n5y_sln_b2c__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 3. Parâmetros]

{#GDA-getName__table_n5y_sln_b2c} {#GDA-getName__table_o5y_sln_b2c__entry__2}

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | Valor da propriedade de nome do atributo dinâmico. |
[Tabela 4. Retorna]

{#GDA-getName__table_o5y_sln_b2c}  
No exemplo a seguir, o valor do nome do objeto de atributo dinâmico é exibido como c .

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue('a->b', 5);    // transient (adding here)
    das.setDynamicAttributeValue('a->c', 10);   // defined in dynamic_attribute table

    var attributes = das.getDynamicAttributes();
    gs.info(attributes);

    for (var i = 0; i < attributes.length; i++) {
        var attr = attributes[i];
    	
        gs.info("");
        gs.info("[" + i + "].getPath()      = " + attr.getPath());
        gs.info("[" + i + "].getName()      = " + attr.getName());
        gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
        gs.info("[" + i + "].getSysId()     = " + attr.getSysId());
        gs.info("[" + i + "].isTransient()  = " + attr.isTransient());
        gs.info("[" + i + "].getType()      = " + attr.getType());
    }

Saída:

    *** Script: a->c,a->b
    *** Script: 
    *** Script: [0].getPath()      = a->c
    *** Script: [0].getName()      = c
    *** Script: [0].getGroupName() = a
    *** Script: [0].getSysId()     = 8bc411a94fc01210b8ddc0e552ce0b3c
    *** Script: [0].isTransient()  = false
    *** Script: [0].getType()      = integer
    *** Script: 
    *** Script: [1].getPath()      = a->b
    *** Script: [1].getName()      = b
    *** Script: [1].getGroupName() = a
    *** Script: [1].getSysId()     = undefined
    *** Script: [1].isTransient()  = true
    *** Script: [1].getType()      = string

## GlideDynamicAttribute - getPath() {#ariaid-title4}

Obtém o valor da propriedade path de um objeto de atributo dinâmico.
{#GDA-getPath__table_n5y_sln_b2c__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 5. Parâmetros]

{#GDA-getPath__table_n5y_sln_b2c} {#GDA-getPath__table_o5y_sln_b2c__entry__2}

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | Valor do caminho do atributo dinâmico. |
[Tabela 6. Retorna]

{#GDA-getPath__table_o5y_sln_b2c}  
No exemplo a seguir, o valor do caminho do objeto de atributo dinâmico é exibido como a-\>c .

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue('a->b', 5);    // transient (adding here)
    das.setDynamicAttributeValue('a->c', 10);   // defined in dynamic_attribute table

    var attributes = das.getDynamicAttributes();
    gs.info(attributes);

    for (var i = 0; i < attributes.length; i++) {
        var attr = attributes[i];
    	
        gs.info("");
        gs.info("[" + i + "].getPath()      = " + attr.getPath());
        gs.info("[" + i + "].getName()      = " + attr.getName());
        gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
        gs.info("[" + i + "].getSysId()     = " + attr.getSysId());
        gs.info("[" + i + "].isTransient()  = " + attr.isTransient());
        gs.info("[" + i + "].getType()      = " + attr.getType());
    }

Saída:

    *** Script: a->c,a->b
    *** Script: 
    *** Script: [0].getPath()      = a->c
    *** Script: [0].getName()      = c
    *** Script: [0].getGroupName() = a
    *** Script: [0].getSysId()     = 8bc411a94fc01210b8ddc0e552ce0b3c
    *** Script: [0].isTransient()  = false
    *** Script: [0].getType()      = integer
    *** Script: 
    *** Script: [1].getPath()      = a->b
    *** Script: [1].getName()      = b
    *** Script: [1].getGroupName() = a
    *** Script: [1].getSysId()     = undefined
    *** Script: [1].isTransient()  = true
    *** Script: [1].getType()      = string

## GlideDynamicAttribute - getSysId() {#ariaid-title5}

Obtém o sys_id de um objeto de atributo dinâmico.
{#GDA-getSysId__table_n5y_sln_b2c__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 7. Parâmetros]

{#GDA-getSysId__table_n5y_sln_b2c} {#GDA-getSysId__table_o5y_sln_b2c__entry__2}

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | Valor do sys_id do atributo dinâmico. |
[Tabela 8. Retorna]

{#GDA-getSysId__table_o5y_sln_b2c}  
No exemplo a seguir, o valor do sys_id do objeto de atributo dinâmico é exibido como 8bc411a94fc01210b8ddc0e552ce0b3c .

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue('a->b', 5);    // transient (adding here)
    das.setDynamicAttributeValue('a->c', 10);   // defined in dynamic_attribute table

    var attributes = das.getDynamicAttributes();
    gs.info(attributes);

    for (var i = 0; i < attributes.length; i++) {
        var attr = attributes[i];
    	
        gs.info("");
        gs.info("[" + i + "].getPath()      = " + attr.getPath());
        gs.info("[" + i + "].getName()      = " + attr.getName());
        gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
        gs.info("[" + i + "].getSysId()     = " + attr.getSysId());
        gs.info("[" + i + "].isTransient()  = " + attr.isTransient());
        gs.info("[" + i + "].getType()      = " + attr.getType());
    }

Saída:

    *** Script: a->c,a->b
    *** Script: 
    *** Script: [0].getPath()      = a->c
    *** Script: [0].getName()      = c
    *** Script: [0].getGroupName() = a
    *** Script: [0].getSysId()     = 8bc411a94fc01210b8ddc0e552ce0b3c
    *** Script: [0].isTransient()  = false
    *** Script: [0].getType()      = integer
    *** Script: 
    *** Script: [1].getPath()      = a->b
    *** Script: [1].getName()      = b
    *** Script: [1].getGroupName() = a
    *** Script: [1].getSysId()     = undefined
    *** Script: [1].isTransient()  = true
    *** Script: [1].getType()      = string

## GlideDynamicAttribute - gettype() {#ariaid-title6}

Obtém o valor da propriedade de tipo de um objeto de atributo dinâmico.
{#GDA-getType__table_n5y_sln_b2c__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 9. Parâmetros]

{#GDA-getType__table_n5y_sln_b2c} {#GDA-getType__table_o5y_sln_b2c__entry__2}

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | Valor do tipo de dados do atributo dinâmico. |
[Tabela 10. Retorna]

{#GDA-getType__table_o5y_sln_b2c}  
No exemplo a seguir, o valor do tipo de objeto de atributo dinâmico é exibido como número inteiro .

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue('a->b', 5);    // transient (adding here)
    das.setDynamicAttributeValue('a->c', 10);   // defined in dynamic_attribute table

    var attributes = das.getDynamicAttributes();
    gs.info(attributes);

    for (var i = 0; i < attributes.length; i++) {
        var attr = attributes[i];
    	
        gs.info("");
        gs.info("[" + i + "].getPath()      = " + attr.getPath());
        gs.info("[" + i + "].getName()      = " + attr.getName());
        gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
        gs.info("[" + i + "].getSysId()     = " + attr.getSysId());
        gs.info("[" + i + "].isTransient()  = " + attr.isTransient());
        gs.info("[" + i + "].getType()      = " + attr.getType());
    }

Saída:

    *** Script: a->c,a->b
    *** Script: 
    *** Script: [0].getPath()      = a->c
    *** Script: [0].getName()      = c
    *** Script: [0].getGroupName() = a
    *** Script: [0].getSysId()     = 8bc411a94fc01210b8ddc0e552ce0b3c
    *** Script: [0].isTransient()  = false
    *** Script: [0].getType()      = integer
    *** Script: 
    *** Script: [1].getPath()      = a->b
    *** Script: [1].getName()      = b
    *** Script: [1].getGroupName() = a
    *** Script: [1].getSysId()     = undefined
    *** Script: [1].isTransient()  = true
    *** Script: [1].getType()      = string

## GlideDynamicAttribute - isTransient() {#ariaid-title7}

Retorna se um objeto é um atributo dinâmico transiente.
{#GDA-isTransient__table_n5y_sln_b2c__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 11. Parâmetros]

{#GDA-isTransient__table_n5y_sln_b2c} {#GDA-isTransient__table_o5y_sln_b2c__entry__2}

| Tipo | Descrição |
|-|-|
| Booliano | Sinalizador que indica se um atributo dinâmico é transitório. Valores válidos: * Verdadeiro: O atributo dinâmico é transitório. Os atributos dinâmicos são definidos na tabela Atributo dinâmico \[dynamic-attribute\] com um tipo de dados e um sys-id. * Falso: O atributo dinâmico não é transitório. Os atributos dinâmicos transientes são atributos dinâmicos que foram adicionados a um DynamicAttributeStore Campo sem uma definição na tabela Atributo dinâmico \[dynamic_attribute\]. Os atributos dinâmicos transientes são manipulados como cadeias de caracteres e não têm sys_id. {#GDA-isTransient__ul_trp_nxn_b2c} Nota: A tabela Atributo dinâmico \[dynamic_attribute\] pode ser acessada navegando até TudoEsquema dinâmicoGrupos de atributos dinâmicos, selecionando um grupo e selecionando Atributos dinâmicos . |
[Tabela 12. Retorna]

{#GDA-isTransient__table_o5y_sln_b2c}  
No exemplo a seguir, o. IsTransient() retornos de método falso para o objeto não transitório.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue('a->b', 5);    // transient (adding here)
    das.setDynamicAttributeValue('a->c', 10);   // defined in dynamic_attribute table

    var attributes = das.getDynamicAttributes();
    gs.info(attributes);

    for (var i = 0; i < attributes.length; i++) {
        var attr = attributes[i];
    	
        gs.info("");
        gs.info("[" + i + "].getPath()      = " + attr.getPath());
        gs.info("[" + i + "].getName()      = " + attr.getName());
        gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
        gs.info("[" + i + "].getSysId()     = " + attr.getSysId());
        gs.info("[" + i + "].isTransient()  = " + attr.isTransient());
        gs.info("[" + i + "].getType()      = " + attr.getType());
    }

Saída:

    *** Script: a->c,a->b
    *** Script: 
    *** Script: [0].getPath()      = a->c
    *** Script: [0].getName()      = c
    *** Script: [0].getGroupName() = a
    *** Script: [0].getSysId()     = 8bc411a94fc01210b8ddc0e552ce0b3c
    *** Script: [0].isTransient()  = false
    *** Script: [0].getType()      = integer
    *** Script: 
    *** Script: [1].getPath()      = a->b
    *** Script: [1].getName()      = b
    *** Script: [1].getGroupName() = a
    *** Script: [1].getSysId()     = undefined
    *** Script: [1].isTransient()  = true
    *** Script: [1].getType()      = string


