# getVarAttr

## Description

Returns the attribute value of an object or array variable.

## Input / Parameter

| Name    | Description                                   | Input Type  | Default | Options | Required |
| ------- | --------------------------------------------- | ----------- | ------- | ------- | -------- |
| var     | The name of the variable.                     | String/Text | -       | -       | Yes      |
| attr    | The attribute of the variable to be obtained. | String/Text | -       | -       | Yes      |
| default | The default value of the variable.            | String/Text | -       | -       | Yes      |

## Output

| Description                                                                                                        | Output Type |
| ------------------------------------------------------------------------------------------------------------------ | ----------- |
| Returns the attribute value of the object if there is a value, returns default value passed by the user otherwise. | String/Text |

## Callback

N/A

## Video

Coming Soon.

## Example

The user wants to use a value of an attribute from global variable which had been declared.

### Step

1. Assuming you have followed the "setVar" fuction in help document, call the function.

   ![](/files/1AMYFk0xnPtxdzKd0thb) ![](/files/J7nQb9Nnn2wFQu9ga8lN)

### Result

In console, user can the string "CodeABC". If user variable "vObject" have no value, it will display "No Value".

## Links


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/app/getvarattr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
