Skip to main content

Validate Formula Expression

POST 

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

Validate a user-entered formula expression before saving. The formula is parsed via Symfony ExpressionLanguage against a whitelist of functions (IF, COALESCE, ROUND, NULLIF, etc.) and field references ({field_name}).

Request body:

  • formula (string, required, max 2000): The expression to validate
  • base_entity (string, optional): Entity context for field reference resolution
  • available_columns (array, optional): Available columns in the current report for reference validation

Returns { valid: true } or { valid: false, error: '...' }. Rejects SQL-injection attempts and unknown field references.

Request

Responses

Successful response