# Run Workflow Trigger Lookup

List the choices of one dropdown of a trigger in the workflow's draft, or find the one you mean with q (or search), exactly as the editor loads them: the app's fixed options, a preset list, or a read from the app with the trigger's connection at its app version. A dropdown that depends on another (a project in a workspace) reads the trigger's arguments; send arguments to try values without saving them. Set the value with Update Workflow Trigger Configuration.

`POST https://connect.mindcloud.co/v2/workflows/:workflowId/triggers/:triggerId/lookups`

Permissions: `workflow:edit`.

## Parameters

### Path

- `workflowId` (string, required): The workflow's id.
- `triggerId` (string, required): The trigger's id, from List Workflow Triggers.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Body

- `for` (string, required): The dropdown: arguments.<path>, options.filter.field, options.sort.field or options.customArguments.fields.
  arguments.<path> for a list argument (arguments.contact.status), options.filter.field, options.sort.field, or options.customArguments.fields.
- `arguments` (object): Argument values to use for this lookup only.
  Argument values to use for this lookup only, merged into the trigger's as an update would be and not saved: a dropdown that depends on another follows an unsaved choice.
- `q` (string): Text to find a choice by. Left out, every choice is listed.
  Text to find a choice by, such as a channel, user, customer or project name. Left out or empty, every choice is listed.
- `search` (string): The same as q, the name these lookups first took. Send one of the two.
- `limit` (number): Choices per page, 1 to 200.
  Choices per page when listing, 1 to 200 (default 50).
  Default: `50`
- `offset` (number): Choices to skip.
  Choices to skip when listing.
  Default: `0`
- `environmentId` (string): The environment a "By environment" trigger's connection is picked for, from List Environments. Defaults to the company's default environment.
  The environment whose connection a "By environment" trigger reads with, from List Environments. Left out, the company's default environment.

## Example request

```bash
curl --request POST \
  --url 'https://connect.mindcloud.co/v2/workflows/Wq3kZ8pLx2Nb/triggers/Tk3pQ8mWz1Ra/lookups' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "for": "arguments.channel",
  "arguments": {
    "workspace": "8412"
  },
  "q": "support",
  "limit": 50,
  "offset": 0,
  "environmentId": "Ev8kT3nW5qLz"
}'
```

## Response fields

- `status` (string): listed (every choice, in pages), resolved (q matched one), ambiguous (q matched several), or notFound.
  Allowed values:
    - `listed`
    - `resolved`
    - `ambiguous`
    - `notFound`
- `reasonCode` (string): NO_QUERY, EXACT_MATCH, STRONG_MATCH, MULTIPLE_HIGH_CONFIDENCE_CANDIDATES, INSUFFICIENT_CONFIDENCE, or NO_CANDIDATES.
- `selected` (object): The choice q matched, when resolved.
  - `value` (string): The value to set.
  - `label` (string): What the choice is called.
- `candidates` (array of objects): The choices: a page of them when listed, the best matches when ambiguous.
  - `value` (string): The value to set.
  - `label` (string): What the choice is called.
- `source` (string): Where the choices came from: fixedOptions (the app's own list), list (countries, currencies or time zones), or lookupAction (a read from the app with the trigger's connection).
  Allowed values:
    - `fixedOptions`
    - `list`
    - `lookupAction`
- `paging` (object): The page of a listing.
  - `limit` (number): Choices per page.
  - `offset` (number): Choices skipped.
  - `total` (number): How many choices there are.
- `hints` (array of objects): What to do next when q did not settle on one choice.
  - `code` (string): The reason code.
  - `message` (string): What to do.
