---
title: getProducts
slug: viewer-3d/methods/getProducts
docTags: 
createdAt: 2024-03-01T14:17:48.683Z
---

Returns product data for the specified objects.

## Example

::codepen{url="https://codepen.io/Catenda/embed/RwzgOdy"}

## Usage

```javascript
const objectIds = ["object-id-1, object-id-2"];

const products = viewer3d.getProducts(objectIds);
```

## Parameters

### objectIds

List of object ids to limit result, returns all products by default.

| **Type**       | **Required** |
| -------------- | ------------ |
| Array\[String] | No           |

## Return Value

List of product data.

| **Type**               |
| ---------------------- |
| Array\[Object or Null] |

:::hint{type="info"}
If any of the ids in the list are invalid, the corresponding entry in the returned list will be null.
:::

**Properties**

| **Name**     | **Type**     | **Description**   |
| ------------ | ------------ | ----------------- |
| `ifcType`    | String       | IFC type          |
| `modelId`    | String       | Id of the model   |
| `objectId`   | String       | Id of the object  |
| `attributes` | Map\[Object] | Object attributes |

**attributes**

:::hint{type="info"}
Only supports attribute type of `GlobalId`
:::

| **Type**     |
| ------------ |
| Map\[Object] |

**Properties**

| **Name**  | **Type** | **Description**        |
| --------- | -------- | ---------------------- |
| `type`    | String   | Type of the attribute  |
| `ifcType` | String   | IFC type               |
| `value`   | String   | Value of the attribute |

### Example

```json
[
  {
    ifcType: "IfcWall",
    modelId: "model-id",
    objectId: "object-id-1",
    attributes: {
      GlobalId: {
        ifcType: "IfcGloballyUniqueId",
        type: "string",
        value: "2_TmT90tD0x9tJSTsyTb1J"
      }
    }
  },
  {
    ifcType: "IfcDoor",
    modelId: "model-id",
    objectId: "object-id-2",
    attributes: {
      GlobalId: {
        ifcType: "IfcGloballyUniqueId",
        type: "string",
        value: "2_LeT78tF0x5tDSRsyHt5K"
      }
    }
  }
];
```

