# previewWorkflowTableLookup

Call this before you say which row, or which value, a named contact, property, deal or appointment gets from a table: a county or key guessed from an address is not the answer. Which row of one Workflow Table a run on a record would use, and each column's value by `columnId` (names from getWorkflowTable): `input` takes `workflowTableId` and a `contactId`, `propertyId`, `dealId` or `appointmentId`, resolved exactly as a workflow run resolves it (fallback levels, ranges, composite keys). `match` DEFAULT means no key matched and the default row answered; NONE means nothing answered. `missingSubjects` names records the key needed and the record could not reach. Same gate as the rows.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "previewWorkflowTableLookup", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `input`: `PreviewWorkflowTableLookupInput!` (required). The subject to resolve a Workflow Table against. At least one record is required. The lookup derives what a table's keys need from what is given, exactly as a run does: a property in hand wins for property-keyed tables, and a deal or appointment reaches its linked properties and contacts.
  - `workflowTableId`: `ID!` (required)
  - `contactId`: `ID`. A contact in the viewer's organization. Any other contact is refused.
  - `propertyId`: `ID`. A property id as the wire carries it (an esId).
  - `pipelineItemId`: `ID`. A deal on a pipeline the viewer's organization can reach. Any other deal is refused.
  - `dealId`: `ID`
  - `appointmentId`: `ID`. An appointment (a task) with a contact or deal of the viewer's organization. Any other is refused.

## Response (data, an example)

```json
{
  "workflowAutomationsQuery": {
    "previewWorkflowTableLookup": {
      "key": "…",
      "match": "KEY",
      "rowId": "<ID>",
      "rowKey": "…",
      "rowKeyLabel": "…",
      "missingSubjects": [
        "CONTACT"
      ],
      "values": [
        {
          "columnId": "<ID>",
          "value": "…"
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "previewWorkflowTableLookup",
    "variables": {
      "input": {
        "workflowTableId": "<workflowTableId>"
      }
    }
  }'
```
