FormAnswer
A FormAnswer represents a single question's answer extracted from a form submission. It is the return type of the findAnswers* family of CQL functions.
Unlike FormResponseFormResponse, which represents an entire form submission with all its answers, a FormAnswer is focused on one specific question — making it easy to aggregate or analyze a single field across many submissions.
Properties
Property | Type | Description |
|---|---|---|
answerValue | @Any | The value given for this question. The type depends on the question — for example, a numeric rating question returns a number, a text question returns a string. |
assessmentId | StringString | The ID of the assessment cycle this response was part of, or null if the submission was not associated with an assessment |
formId | StringString | The ID of the form the answer came from |
formResponseId | StringString | The ID of the parent FormResponseFormResponse this answer belongs to |
questionId | StringString | The ID of the question this answer is for |
submitAt | TimestampTimestamp | The timestamp the form was submitted |
submitPerson | PersonPerson | The person who submitted the form, or null if anonymous |
target | PersonPerson | The person the form was about (the target), or null if the form had no target |
Usage Notes
FormAnswer is designed for aggregation. The most common pattern is to chain it with .mean{}, .count(), or .groupBy{} to derive insights from a specific question across many responses.
The answerValue property holds the raw answer value. For numeric questions (ratings, scores), you can use .mean{answerValue} directly. For enum/label questions, use .groupBy{answerValue}.count() to see the distribution.
Examples
findAnswers('managerReviewRating', '-365d').mean{answerValue}
Average manager review rating across the org over the past year.
findAnswersByAssessment('managerReviewRating', 'Q3 2024 Performance Review').groupBy{target.department}.mean{answerValue}
Average manager review rating per department within a specific assessment cycle.
findAnswersByTarget('peerFeedbackImpactRating', person, '-180d').count()
Number of peer feedback impact ratings submitted about the current person in the past 6 months.
See Also
- FormResponseFormResponse — the full form submission object
- findAnswers() — retrieve answers for a question across the org
- findAnswersByForm() — scope answers to a specific form
- findAnswersByAssessment() — scope answers to a specific assessment cycle
- findAnswersByTarget() — scope answers about a specific person
