Skip to main content

Validate Formula Expression

POST 

/api/v2/report-builder/validate-formula

Check a calculated-column formula before saving it in a column's formula.

Required scope: reports:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body:

  • formula (string, required, max 2000): the expression. Reference the entity's measures by their bare key (e.g. total_revenue, order_count); numbers, quoted strings, arithmetic (+ - * /), comparisons and these functions are allowed: ROUND, ABS, CEIL, FLOOR, MOD, POWER, IF, CASE, COALESCE, NULLIF, CONCAT, UPPER, LOWER, TRIM, LENGTH, REPLACE, SUBSTRING, DATEDIFF, DATE_ADD, YEAR, MONTH, DAY, DATE_FORMAT, CAST, NOW.
  • entity_key (string, required): the entity whose measures the formula may reference

Returns {"valid": true}, or {"valid": false, "error": "..."} with status 200 when the formula is malformed or references an unknown measure. An unknown entity_key returns 422 with the same shape.

Authentication: Bearer token (Personal Access Token). Personal access tokens need the reports:write scope.

Request​

Responses​

OK

Response Headers
    Content-Type