logo SmartSurvey / Scripting Docs
Back to Docs
Built-in Function
stringof[Qx] String

Returns the label text of the selected option for a single-response question. Use when you need to compare or display the actual option label rather than its numeric code.

Parameters
Parameter Type Description
Qx Question ref A *SR question
Returns: String — the label of the selected option
Examples
expressions
stringof[Q1]='BrandA'   -- respondent selected the option labelled BrandA
stringof[Q24]='Dhaka'   -- selected district is Dhaka
Comparison is case-sensitive. The label must match exactly as defined in the script.
Prefer numeric code comparisons (Q1=1) over string comparisons for reliability and performance.
Related