> For the complete documentation index, see [llms.txt](https://docs.opshub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opshub.com/upcoming-release/connector-sdk-index/sdk-connector-apis/lookup-field-value-get.md).

# Lookup Field Value Get

### Overview

OpsHub will call this API for fields of type LOOKUP. Implementation of this API should return valid values that the user can set in a given lookup field.

### API URI

```bash
GET: /metadata/fields/{fieldId}/values?projectId=<projectId>&entityTypeId=<entityTypeId>&fieldScope=<FieldScope>
```

### URI Parameters

| Name         | In    | Required | Type   | Description                                                                                                                                                                                                                                                                                                                                                                        |
| ------------ | ----- | -------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| entityTypeId | path  | True     | String | ‘id’ of entity type returned as response of **Entity Type – List** API                                                                                                                                                                                                                                                                                                             |
| fieldId      | path  | True     | String | Id of the field, as sent by Connector SDK from `/entity-types/{entityTypeId}` API                                                                                                                                                                                                                                                                                                  |
| projectId    | query | True     | String | Project id for which the list of entity types is available. ProjectId here will be the same as ‘id’ sent as part of `/projects`                                                                                                                                                                                                                                                    |
| FieldScope   | query | True     | ENUM   | <p>Scope where Lookup values for a field are to be displayed.<br>- <strong>ENTITY\_FIELD</strong>: Provide 'ENTITY\_FIELD' when lookup values are to be displayed at mapping level.<br>- <strong>CONFIG\_FIELD</strong>: Provide 'CONFIG\_FIELD' when lookup values are to be displayed at advanced integration configuration level in entity-level mandatory settings screen.</p> |

### Response Payload

```json
[
  {
    "id": "<id1>",
    "value": "<value1>"
  },
  {
    "id": "<id2>",
    "value": "<value2>"
  },
  {
    "id": "<id3>",
    "value": "<value3>"
  }
]
```

### Response Parameters

| Name  | Required | Type   | Description                                                                                                                                                                                             |
| ----- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id    | True     | String | Internal value of the field. For example, for priority field: "low", "medium", and "high". If the end system does not have a different internal name for a field value, pass the display name here too. |
| value | True     | String | Display value of the field. For example, for priority field: "Low", "Medium", and "High".                                                                                                               |

## Examples

1. Sample response for priority field:

```json
[
  {
    "id": "1",
    "value": "High"
  },
  {
    "id": "2",
    "value": "Medium"
  },
  {
    "id": "3",
    "value": "Low"
  }
]
```

2. Sample response for priority field with same id and value:

```json
[
  {
    "id": "High",
    "value": "High"
  },
  {
    "id": "Medium",
    "value": "Medium"
  },
  {
    "id": "Low",
    "value": "Low"
  }
]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opshub.com/upcoming-release/connector-sdk-index/sdk-connector-apis/lookup-field-value-get.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
