---
title: "insight_getObjectAttrType"
canonical: "https://support.appfire.com/space/PSJ/15481376/insight_getObjectAttrType"
format: markdown
---
> Macro (aura-html)


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | insight_getObjectAttrType(id) or insight_getObjectAttrType(objectTypeId, key) | **Package** | insight |
| **Alias** |  | **Pkg Usage** | getObjectAttrType(id) or getObjectAttrType(objectTypeId, key) |

## Description

> Macro (excerpt)
> 
> Returns the type of the attribute, either by id or by objectTypeId and key.

Returns the type of the attribute, either by id or by objectTypeId and key.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| id | Integer | Yes | The id of the object attribute. |

### Or

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| objectTypeId | Integer | Yes | The id of the type of object being queried. |
| key | String | Yes | The key of the attribute. |

## Return Type

**[IObjectAttrType](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15488625)**

## Examples

### Example 1 - getting object attribute type by id

```javascript
use "insight";
IObjectAttrType myAttribute;
myAttribute = getObjectAttrType(12345);
runnerLog(myAttribute.id);
runnerLog(myAttribute.name);
runnerLog(myAttribute.description);
```

Result:

### Example 2 - getting object attribute type by object type id and key

```javascript
use "insight";
IObjectAttrType myAttribute;
myAttribute = getObjectAttrType(12345, "obj123");
runnerLog(myAttribute.id);
runnerLog(myAttribute.name);
runnerLog(myAttribute.description);
```

Result:

## See also

> Macro (contentbylabel)