# previewContactImport

The first rows of an import as the contacts they will become, in the app’s own fields: name, phones, emails, property addresses, mailing addresses, tags, lists, deals, and custom fields (every custom field of the workspace is listed; the ones with values are the ones this row fills). contactTransformerRowCount is the number of rows the import will read. A row with error set and no contact will be skipped. contactTransformerRowFindings names the rows to tell the person about before they approve the import: a likely repeat of an earlier row (the same name and a shared phone or email, or for a nameless row a shared phone or email; the import usually merges it into that contact, so say it likely will, never that it will) and a row with no name (it lands under its phone or email), with 0-based row indexes, over the file’s first checkedRows rows; null means the check did not run, so never say the file has no repeats. limit is 1 to 10 (default 8). Show these rows to the person as a table, one row per contact, a column per field that any row fills, and say how many rows the file has. Read only; nothing is imported.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "previewContactImport", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no
- Result cap: `limit` is clamped to 10, without an error

## Variables

- `fileProcessingTaskId`: `ID!` (required)
- `limit`: `Int` (default `8`)

## Response (data, an example)

```json
{
  "fileProcessingTaskQuery": {
    "contactTransformerRowCount": 0,
    "contactTransformerRowFindings": {
      "checkedRows": 0,
      "repeats": [
        {
          "rowIndex": 0,
          "sameAsRowIndex": 0,
          "name": "…"
        }
      ],
      "namelessRowIndexes": [
        0
      ],
      "unstorablePhoneRowIndexes": [
        0
      ],
      "flaggedRowChannels": [
        {
          "rowIndex": 0,
          "name": "…",
          "phone": "…",
          "email": "…",
          "droppedPhone": "…"
        }
      ]
    },
    "contactTransformerPreview": [
      {
        "rowIndex": 0,
        "error": "…",
        "mappedNoteBody": "…",
        "unlandedCells": [
          "…"
        ],
        "contact": {
          "name": "…",
          "subContacts": [
            {
              "name": "…",
              "relation": "…"
            }
          ],
          "phoneNumbers": [
            {
              "phoneNumber": "…",
              "phoneType": "MOBILE"
            }
          ],
          "emails": [
            {
              "email": "…"
            }
          ],
          "properties": [
            {
              "propertyString": "…"
            }
          ],
          "mailingAddresses": [
            {
              "rawText": "…",
              "address": {
                "line1": "…",
                "line2": "…",
                "city": "…",
                "state": "…",
                "zip": "…"
              }
            }
          ],
          "tags": [
            {
              "name": "…"
            }
          ],
          "lists": [
            {
              "name": "…"
            }
          ],
          "deals": [
            {
              "title": "…",
              "stage": {
                "name": "…"
              },
              "pipeline": {
                "name": "…"
              }
            }
          ],
          "customFields": [
            {
              "name": "…",
              "values": {
                "textValue": "…",
                "numberValue": 0,
                "calendarDate": "…",
                "dropdownSelectedValues": [
                  "…"
                ]
              }
            }
          ]
        }
      }
    ]
  }
}
```

## Example

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