> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryprofound.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Looker in Agents

After connecting your Looker account, the following actions become available as Agent steps. Each step requires you to select a connected **Looker Account** from a dropdown.

Profound pulls **query results** from Looker — rows of metrics and dimensions your analytics team has already modeled — not Looker dashboards or visualizations. Results are returned as structured data (typically JSON) that later agent steps can summarize, compare, or combine with other integrations.

## Available actions

| Action               | What it does                                                                              |
| -------------------- | ----------------------------------------------------------------------------------------- |
| **Run Look**         | Executes a saved Look by ID and returns the result                                        |
| **Run Inline Query** | Builds and runs a query against a model, Explore, and field list you specify in the agent |

<Tabs>
  <Tab title="Run Look" icon="chart-line">
    #### **Run Look**

    Execute a saved Look from your Looker instance and return the result as structured data.

    **Required inputs**

    * **Looker Account**
    * **Look** — a saved Look from the selected account. The dropdown loads Looks from Looker and shows each Look's title with its ID.

    **Optional inputs**

    * **Result Format** — the format returned by Looker. Defaults to `json_bi`, which is recommended for downstream agent steps.
    * **Row Limit** — maximum number of rows to return.

    **Output**

    * **Look Results** — a JSON value containing the returned Looker result.

    <Callout icon="lightbulb" color="#376CFF">
      **Tip:** Use **Run Look** when the query already exists as a saved Look in Looker. This keeps business logic governed in Looker and is the safest option for recurring agent automations.
    </Callout>
  </Tab>

  <Tab title="Run inline query" icon="code">
    #### **Run Inline Query**

    Run a query against a specific Looker model and Explore with fields, filters, sorts, and advanced query options.

    **Required inputs**

    * **Looker Account**
    * **Model** — the Looker model name, such as `marketing`
    * **Explore** — the Explore name, such as `web_event`
    * **Fields** — comma-separated Looker fields, such as `web_event.date, web_event.unique_users`

    **Optional inputs**

    * **Sorts** — comma-separated sorts, such as `web_event.date desc`
    * **Row Limit** — maximum rows to return. Defaults to `500`.
    * **Result Format** — defaults to `json_bi`

    **Advanced inputs**

    * **Filter Expression** — Looker filter expression using `${field}` syntax
    * **Pivots** — comma-separated fields to pivot on
    * **Subtotals** — comma-separated fields to subtotal on
    * **Fill Fields** — comma-separated fields to fill missing rows for, usually date fields
    * **Dynamic Fields** — JSON string for table calculations or custom dimensions
    * **Column Limit** — maximum number of columns to return
    * **Total** — whether Looker should include totals
    * **Row Total** — row total type, such as `right`
    * **Query Timezone** — optional IANA timezone, such as `America/Los_Angeles`
    * **Server Table Calcs** — whether table calculations should run on the server
    * **Apply Formatting** — whether Looker formatting should be applied to the result

    **Output**

    * **Query Results** — a JSON value containing the returned Looker result.

    <Callout icon="lightbulb" color="#376CFF">
      **Tip:** Use field names exactly as they appear in Looker, including the `view.field` prefix. For date filters, use Looker filter syntax from your LookML model (for example, `30 days` on a date field).
    </Callout>
  </Tab>
</Tabs>

***

## What data is available

Query results depend on the Look or Explore you run. In general, Looker returns the fields defined in your LookML model:

| Data type              | Description                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------- |
| **Dimensions**         | Attributes you group or filter by, such as date, channel, region, or product           |
| **Measures**           | Aggregated metrics, such as revenue, session count, conversion rate, or unique users   |
| **Filters & sorts**    | Applied at query time — either baked into a saved Look or specified in an inline query |
| **Totals & subtotals** | Optional row or column totals when enabled on inline queries                           |

Profound returns the raw query result as structured data (typically JSON). Your agent or sheet decides what to do with it — summarize it, compare periods, or pass rows to another step.

## Supported result formats

Both actions support multiple Looker result formats. **`json_bi`** is the default and recommended format for agent workflows because it returns structured JSON that downstream steps can parse reliably.

Other supported formats: `json`, `csv`, `txt`, `html`, `md`, `xlsx`, `sql`, `png`, and `jpg`. Use non-JSON formats only when a later step explicitly needs that output type.

## Limits

* **Run Inline Query** defaults to **500 rows** and supports up to **5,000 rows** per run.
* **Run Look** supports an optional row limit override up to **5,000 rows**.
* The connected Looker user's permissions still apply — Profound cannot return data the API user cannot access.

***

## Choosing an action

| Use **Run Look** when…                                        | Use **Run Inline Query** when…                            |
| ------------------------------------------------------------- | --------------------------------------------------------- |
| The query is already saved and approved in Looker             | The agent needs dynamic fields, filters, or date windows  |
| You want Looker to remain the source of truth for query logic | You are building parameterized reporting inside the agent |
| You need a simple, governed recurring report                  | Earlier agent steps determine which metrics to fetch      |

***

## Common use cases

* Pull a saved traffic or revenue Look into a weekly summary agent
* Fetch governed KPIs from Looker and pass them to a content-generation step
* Run dynamic inline queries with date windows that change based on agent inputs
* Combine Looker metrics with data from other integrations in a single agent
* Import a saved Look into a Sheet to analyze metrics alongside agent-generated columns

***

## Best practices

* Prefer `json_bi` for downstream agent steps because it returns structured data
* Start with a saved Look when possible; use inline queries only when the agent needs dynamic logic
* Keep row limits focused so later steps receive only the data they need
* Make sure the connected Looker user has access to every model, Explore, field, and Look used by the agent

***

## Common errors

<AccordionGroup>
  <Accordion title="Select an integration first">
    The Look dropdown depends on the selected Looker account. Choose a **Looker Account** before selecting a saved Look.
  </Accordion>

  <Accordion title="No Looks found">
    The connected Looker user may not have access to any saved Looks, or the Looks may be in folders the user cannot access.
  </Accordion>

  <Accordion title="Invalid model, Explore, or field">
    Inline queries must use Looker model, Explore, and field names exactly as they exist in Looker.
  </Accordion>

  <Accordion title="Permission denied">
    Profound uses the connected Looker API user. Update that user's Looker role, model set, or folder permissions if the agent cannot access the requested data.
  </Accordion>
</AccordionGroup>
