OPScript Language & Syntax Reference
The declarative survey-as-code markup language powering Nuvopoll's instant compiler, logic routing, compliance triggers, and scoring engine.
Why Survey-as-Code?
Traditional drag-and-drop builders are slow and cumbersome for complex research. OPScript lets you paste word documents or questionnaire drafts into structured JSON forms in seconds, complete with matrix blocks, scoring, and GDPR compliance tags.
1. Global Metadata Tags (@SURVEY, @DESC, @INTRO, @OUTRO)
Declare global survey parameters at the very top of your script using single-line metadata decorators:
@SURVEY:— Main survey title.@DESC:— Research description and methodology summary.@INTRO:— Welcome screen headline and participant onboarding copy.@OUTRO:— Completion screen message and closing note.
@SURVEY: 2026 Customer Satisfaction Survey @DESC: Your feedback is crucial for improving our services. @INTRO: Welcome! This survey will take approximately 3 minutes. @OUTRO: Thank you for participating. Have a great day!
2. Pages and Sections (--- and # Section Title)
Easily divide questions into pages and thematic sections:
---— Page Break: Exactly three hyphens create a new survey page.--- Page Title— Page break with a custom page header (e.g.--- Demographics).# Section Title— Declares a new section; plain text immediately below becomes section description.- Note: Single or double hyphens (
-or--) on their own lines are treated as visual spacers and skipped.
# Onboarding & Experience The following questions evaluate your experience over the past month. 1. How satisfied are you with our platform overall? - Very Satisfied - Satisfied - Dissatisfied -- --- Demographics 2. What is your age group? - 18 - 24 - 25 - 34 - 35 and above
3. Question Attributes ([POINT], [MIN_CHARS], [MAX_CHARS], [REQUIRED])
Attach properties inside brackets at the end of the question title or on the line directly beneath it:
[POINT: 10]— Assigns score points for assessment / qualification evaluation.[EXPLANATION: "..."]or[AÇIKLAMA: "..."]— Solution feedback explanation displayed in the answer review.[MIN_CHARS: 50]— Enforces a minimum character length on open-ended text fields.[MAX_CHARS: 500]— Sets the maximum allowed characters for text questions.[REQUIRED]— Makes the question mandatory (or prefix with asterisk:*1. Question).[ID: variable_name]— Technical identifier used in SPSS (.sav), R, and CSV exports.{piping_key}— Variable tag to pipe answers into subsequent questions using{{piping_key}}.
1. What is the capital city of France? [POINT: 10] [REQUIRED] [ID: q_capital] [EXPLANATION: "Paris has been the capital of France since 987 AD."] - Lyon [POINT: 0] - Paris [POINT: 10] [EXPLANATION: "Correct! Paris is the capital of France."] - Marseille [POINT: 0] 2. Please provide detailed comments on your experience: [TYPE: TEXT] [MIN_CHARS: 50] [MAX_CHARS: 500]
4. Choice Options and Scoring ([POINT: X])
Options start with -, *, or letters like a). Each option can hold independent scores or database codes:
- Option [POINT: 5]— Assigns numeric points to the selected choice.- Option [EXPLANATION: "..."]— Assigns an option-specific explanation displayed in answer review.- Option {code}— Custom backend storage code.- Option [PIPING: text]— Custom text string piped when selected.- Other [FIXED]— Prevents randomization from reshuffling this specific option.
1. How easy was it to navigate our platform?
- Excellent {opt_ex} [POINT: 5]
- Good {opt_good} [POINT: 4]
- Average {opt_avg} [POINT: 3]
- Poor {opt_poor} [POINT: 1]
- No Opinion [POINT: 0] [FIXED]5. Matrix Blocks ([ROWS] and [COLUMNS])
Define grid and Likert matrix questions effortlessly with [ROWS] and [COLUMNS] blocks:
1. Please rate the following service dimensions [TYPE: MATRIX LIKERT]
[ROWS]
- Mobile Application Experience
- Customer Support Responsiveness
- Product Feature Variety
[COLUMNS]
- Very Poor {1}
- Poor {2}
- Neutral {3}
- Good {4}
- Excellent {5}6. Conditional Routing & Logic Rules ([LOGIC: ...])
Add branching rules directly below options using [LOGIC: IF ... THEN ...] syntax:
[LOGIC: IF == "No" THEN GOTO q_final]— Skip directly to a target question ID.[LOGIC: IF "A" OR "B" THEN JUMP TO SECTION sec_2]— Branch to another section.[LOGIC: IF ANSWERED THEN END]— Early termination / screenout.
1. Did you interact with our customer support in the last 30 days? [ID: q_support] - Yes - No [LOGIC: IF == "No" THEN GOTO q_final] 2. How would you rate your overall satisfaction? [ID: q_final] - Satisfied - Dissatisfied
GDPR & PII Compliance Triggers
OPScript supports question-level compliance declarations. Marking questions as PII or Sensitive triggers automatic Privacy Notices and explicit consent consent checkboxes at the onboarding screen.
7. Personal Data & Sensitive Information Compliance ([PII], [SENSITIVE])
Declare data protection classifications directly in your questions:
[PII]— Marks the question as collecting Personally Identifiable Information (name, email, phone, etc.).[PII_SOURCE: manual]or[PII_SOURCE: auto]— Identifies data collection origin.[SENSITIVE]— Flags special-category sensitive data (health, biometric, religious, or political beliefs) under GDPR Article 9.[SENSITIVE_TYPES: health, biometric]— Comma-separated categories of sensitive information.[SENSITIVE_DESC: "..."]— Sealed compliance description explaining the processing rationale.
1. Please provide your full name and work email: [TYPE: TEXT] [PII] [PII_SOURCE: manual] [REQUIRED] 2. Do you have any dietary health restrictions? [SENSITIVE] [SENSITIVE_TYPES: health] [SENSITIVE_DESC: "Used solely for catering allergy precautions."] - Yes - No
8. Voice, Media, Other Option & Scale Controls
Advanced interaction features for modern conversational and multimedia studies:
[VOICE]— Enables microphone speech-to-text input.[AUDIO RECORD]— Records raw participant voice and triggers Cloud AI batch transcription. Use[DURATION: 60]to limit seconds.[OTHER: "Specify..."]— Appends a dynamic free-text "Other" field at the bottom of the choice list.[RANGE: 1-10]or[MIN: 1] [MAX: 10]— Numerical range bounds for ratings or Likert scales.[LABEL: 1="Low", 10="High"]— Semantic anchors for scale extremes and intermediate steps.[HELP: "Guidance text"]— Interactive tooltip guidance next to the question title.[MEDIA: https://...]and[CAPTION: "..."]— Embeds an image or video above the question.
1. Record your spontaneous feedback about our new feature: [TYPE: AUDIO] [AUDIO RECORD] [DURATION: 60] [HELP: "Press the microphone button and speak for up to 60 seconds."] 2. Which device do you use most frequently? - Smartphone - Laptop / Desktop - Tablet [OTHER: "Other (Please specify)"] 3. Rate the ease of onboarding on a scale of 1 to 10: [TYPE: RATING] [RANGE: 1-10] [LABEL: 1="Very Difficult", 10="Effortless"] 4. How would you evaluate our new interface concept? [MEDIA: https://example.com/concept.jpg] [CAPTION: "2026 Next-Gen User Dashboard"] - Outstanding - Needs Improvement - Unsatisfactory
9. Multilingual OPScript & Dynamic Text Piping Syntax
OPScript natively supports declaring multiple languages within a single unified script, alongside robust dynamic option piping:
@LANG: en, tror@DİL: tr, en— Declares the survey's supported languages and target locale order.1. {var} Question in English || Question en Français— Splits localized question titles using the double pipe (||) separator.- Option text => Piped value text— Defines the dynamic value to inject into subsequent questions when this option is selected.- Option EN || Option TR => Piped EN || Piped TR— Synchronizes both option labels and language-specific piping dictionaries.2. What do you think about {{var}}? || {{var}} hakkında ne düşünüyorsunuz?— Injects piped variables across any language.
@LANG: en, tr
@SURVEY: Customer Experience Survey || Müşteri Deneyimi Araştırması
@DESC: We value your candid feedback. || Görüşleriniz bizim için değerlidir.
1. {brand} Which of our product ecosystems do you utilize most? || En sık hangi ürün ekosistemimizi kullanıyorsunuz?
- Home & Smart Living || Ev & Akıllı Yaşam => smart living setup || akıllı yaşam çözümleri
- Enterprise Workstations || Kurumsal İş İstasyonları => enterprise workstations || kurumsal iş istasyonları
- Cloud Developer Tools || Bulut Geliştirici Araçları => cloud platform || bulut platformu
2. How reliable has your {{brand}} been over the past 6 months? || Son 6 ayda {{brand}} deneyiminiz ne kadar güvenilirdi?
- Highly Reliable || Son Derece Güvenilir
- Moderate || Orta Düzey
- Unreliable || Güvenilmez10. Dedicated Personal Data Types ([TYPE: FULL NAME], [TYPE: EMAIL], etc.)
OPScript natively provides four specialized question types for securely capturing contact and identity records:
[TYPE: FULL NAME]— Full name input field.[TYPE: EMAIL]— Email input field with format validation.[TYPE: PHONE]— International phone number field with country dial code selector.[TYPE: ADDRESS]— Structured 5-subfield postal address field.
1. Full Name: [TYPE: FULL NAME] [REQUIRED] 2. Email Address: [TYPE: EMAIL] [REQUIRED] 3. Contact Phone Number: [TYPE: PHONE] 4. Mailing and Delivery Address: [TYPE: ADDRESS] [REQUIRED]