Skip to main content

Generating queries with AI

Don't feel like writing SQL? Describe what you want in plain language and the console writes the query for you, grounded in your snapshot's actual schema — real table and column names, not guesses.

How to use it

  1. In the Query Console, click Ask AI to open the AI bar.
  2. Describe what you want — for example: "accounts created this year with no opportunities" — and click Generate.
  3. The generated SQL lands in the editor for you to review.
  4. Run it, tweak it, or refine your request and regenerate.

[SCREENSHOT REQUIRED: AI query bar with a natural-language request and the generated SQL in the editor]

Pin an object with @-mentions

Type @ in the AI bar to mention a specific object — e.g. "biggest deals per region from @Opportunity". Mentioning an object pins its exact columns into the AI's context, which makes the generated query noticeably more precise on orgs with many similarly-named objects.

Example requests

  • "contacts without an email, grouped by account"
  • "monthly count of cases opened vs closed in 2026"
  • "the 20 most recently modified @Lead records with owner name"
  • "duplicate account names with how many times each appears"

Good to know

  • Generated queries are read-only — only SELECT-style explorations are allowed; requests for anything else are refused.
  • You always see the SQL before it runs; nothing executes without you.
  • The AI sees your snapshot's schema (object and field names) to write correct queries — not your records.
  • If AI generation isn't available in your environment, the bar says so; everything else in the console works normally.