# Perspective component get dropdown props from gateway

**URL:** <https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [December 9, 2024, 8:33pm UTC](https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606 "2024-12-09T20:33:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grace\_Gan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Grace\_Gan](https://forum.inductiveautomation.com/u/Grace_Gan)\
**Post date:** [December 9, 2024, 8:33pm UTC](https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606/1 "2024-12-09T20:33:42Z")

</div>

Hi,

I want to create a perspective component with a `input_datapoint_id` property which a list of items will be provided as dropdown to select a single value.

If my dropdown list is fixed I can do this

```python
{
  "type": "object",
  "additionalProperties": false,
  "required": [],
  "properties": {
    "input_datapoint_id": {
      "type": "string",
      "enum": ["one", "two", "three"],
      "description": "Input datapoint id of production loss",
      "default": "one"
    },
  }
}

```

However, What if the dropdown list should be generated dynamically (ideally a query to the gateway would work but how can this be done?), will it be possible to have a dynamic dropdown list for the props of a perspective component?

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [December 9, 2024, 8:43pm UTC](https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606/2 "2024-12-09T20:43:09Z")

</div>

I've never used it, but apparently this exists:

> **[PropertySuggestionSourceRegistry](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.33/com/inductiveautomation/perspective/designer/api/PropertySuggestionSourceRegistry.html)**
>
> declaration: package: com.inductiveautomation.perspective.designer.api, interface: PropertySuggestionSourceRegistry

---

<div class="post-metadata">

**Author:** ![Grace\_Gan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Grace\_Gan](https://forum.inductiveautomation.com/u/Grace_Gan)\
**Post date:** [December 9, 2024, 8:58pm UTC](https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606/3 "2024-12-09T20:58:05Z")

</div>

Cool I'll try that out.

How about if I want to get data from the gateway to populate the dropdown within the component.

Is it possible to do an api call to the gateway to get such data?

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [December 9, 2024, 9:20pm UTC](https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606/4 "2024-12-09T21:20:13Z")

</div>

Seems like an anti-pattern. Components are best when they’re flexible, and making a component do its own queries is at odds with the goals of Ignition. Is there a reason you don’t want to provide your options through a binding?

---

<div class="post-metadata">

**Author:** ![Grace\_Gan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Grace\_Gan](https://forum.inductiveautomation.com/u/Grace_Gan)\
**Post date:** [December 9, 2024, 9:30pm UTC](https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606/5 "2024-12-09T21:30:01Z")

</div>

It's quite a custom component that I am building and I want to abstract away as much things as possible

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [December 9, 2024, 9:37pm UTC](https://forum.inductiveautomation.com/t/perspective-component-get-dropdown-props-from-gateway/99606/6 "2024-12-09T21:37:38Z")

</div>

If you insist.

I’d handle fetching the data in your [ComponentModelDelegate](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.33/com/inductiveautomation/perspective/gateway/api/ComponentModelDelegate.html) and send it the client via an event. You could do this when the delegate starts, on some interval, and/or when the client requests a refresh through a message.
