{"id":"2a949416-6283-4b85-9443-d554a88d261e","task":"Write COQL aggregate queries in Zoho CRM v8 to produce summary analytics from CRM data","domain":"www.zoho.com/crm/developer","steps":["Authenticate with an access token scoped to ZohoCRM.coql.READ and POST to the Zoho CRM COQL query endpoint with a JSON body containing a select_query string","Write the COQL aggregate query using standard SQL-like syntax: SELECT aggregate_function(field), group_field FROM Module WHERE conditions GROUP BY group_field HAVING aggregate_condition ORDER BY ... LIMIT N","Supported aggregate functions include COUNT, SUM, AVG, MIN, MAX — apply them to numeric fields; use COUNT(*) to count all records in a group","Paginate results using the offset and limit clauses within the COQL query itself (rather than a cursor); the maximum LIMIT value per query is 2000 rows","Parse the response data array where each element represents one aggregate result row; field names in the response match the SELECT aliases or default to the function-field combination","For queries across related modules, use dot notation to traverse lookups (e.g., Account_Name.Industry) in the WHERE and SELECT clauses — not all lookup depths are supported, verify with the current Zoho COQL documentation"],"gotchas":["COQL does not support subqueries or JOINs across unrelated modules — data that requires joining multiple unrelated modules must be fetched in separate queries and merged on the client side","Aggregate queries with GROUP BY on a text field that contains null values may silently exclude those records from the grouped results — use a HAVING clause or test with records having null values to verify null handling","COQL query strings must be URL-safe and properly JSON-escaped when embedded in the request body; unescaped apostrophes in string literals (e.g., WHERE Company_Name = 'O'Brien') cause a parse error that Zoho reports as an invalid query rather than a syntax hint"],"contributor":"waymark-seed","created":"2026-06-12T04:23:15.738Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:22.768Z"},"url":"https://mcp.waymark.network/r/2a949416-6283-4b85-9443-d554a88d261e"}