SurveyJS v2.5.0

Released: December 10, 2025

SurveyJS v2.5.0 introduces the capability to access survey element properties within expressions and dynamic texts, and includes bug fixes and minor enhancements.

Access Survey Element Properties Within Expressions and Dynamic Texts

Using element properties in dynamic texts and expressions is helpful when you need to reference metadata that isn't part of the survey result—for example, to read an element's visibility, disabled state, custom property values, or item-level attributes. Starting with SurveyJS v2.5.0, you can reference an element property inside a dynamic text or expression using the following syntax:

Operator Description Example
{$elname.propname} Returns the value of a property on another survey element. {$question1.visible}
{$self.propname} Returns the value of a property on the current element. {$self.choices[0].text}
{$item.propname} Returns the value of a property on a choice item or a matrix row/column within a choicesVisibleIf, rowsVisibleIf, or columnsVisibleIf expression. {$item.score}

For example, the following code uses item-level properties to implement cascading dropdowns. The "program" dropdown filters items based on the selected college, and the "course" dropdown filters items based on the selected program. Both filters use {$item.propname} to access item attributes defined through custom properties.

View Code Example
import { Serializer } from " survey-core";

Serializer.addProperty("itemvalue", { name: "college" });
Serializer.addProperty("itemvalue", { name: "program" });

const surveyJson = {
  "title": "STUDENT FEEDBACK ON CLASSROOM TEACHING",
  "pages": [
    {
      "name": "intro",
      "elements": [
        {
          "type": "dropdown",
          "name": "college",
          "title": "Select your college",
          "placeholder": "Select college...",
          "choices": [
            "Science College",
            "Engineering College",
            "Management College",
            "Medical College",
            "Fine Arts College"
          ]
        },
        {
          "type": "dropdown",
          "name": "program",
          "title": "Program and specialization",
          "choices": [
            { "value": "bsc_cs", "text": "B.Sc - Computer Science", "college": "Science College" },
            { "value": "bsc_phy", "text": "B.Sc - Physics", "college": "Science College" },
            { "value": "bsc_chem", "text": "B.Sc - Chemistry", "college": "Science College" },

            { "value": "btech_cse", "text": "B.Tech - Computer Science & Engineering", "college": "Engineering College" },
            { "value": "btech_mech", "text": "B.Tech - Mechanical Engineering", "college": "Engineering College" },
            { "value": "btech_civil", "text": "B.Tech - Civil Engineering", "college": "Engineering College" },

            { "value": "bba", "text": "BBA - Bachelor of Business Administration", "college": "Management College" },
            { "value": "mba", "text": "MBA - Master of Business Administration", "college": "Management College" },
            { "value": "pgdm", "text": "PGDM - Post Graduate Diploma in Management", "college": "Management College" },

            { "value": "mbbs", "text": "MBBS - Bachelor of Medicine and Surgery", "college": "Medical College" },
            { "value": "bds", "text": "BDS - Bachelor of Dental Surgery", "college": "Medical College" },
            { "value": "bpharma", "text": "B.Pharm - Bachelor of Pharmacy", "college": "Medical College" },

            { "value": "bfa_paint", "text": "BFA - Painting", "college": "Fine Arts College" },
            { "value": "bfa_sculpt", "text": "BFA - Sculpture", "college": "Fine Arts College" },
            { "value": "bfa_photo", "text": "BFA - Photography", "college": "Fine Arts College" }
          ],
          "choicesVisibleIf": "{college} = {$item.college}",
          "enableIf": "{college} notempty",
          "placeholder": "Select program...",
          "startWithNewLine": false
        },
        {
          "type": "dropdown",
          "name": "course",
          "title": "Course or subject taken",
          "choices": [
            { "value": "ds", "text": "Data Structures", "program": "bsc_cs" },
            { "value": "os", "text": "Operating Systems", "program": "bsc_cs" },
            { "value": "algorithms", "text": "Algorithms", "program": "bsc_cs" },

            { "value": "quantum_phy", "text": "Quantum Physics", "program": "bsc_phy" },
            { "value": "optics", "text": "Optics", "program": "bsc_phy" },
            { "value": "thermo", "text": "Thermodynamics", "program": "bsc_phy" },

            { "value": "organic_chem", "text": "Organic Chemistry", "program": "bsc_chem" },
            { "value": "inorganic_chem", "text": "Inorganic Chemistry", "program": "bsc_chem" },
            { "value": "physical_chem", "text": "Physical Chemistry", "program": "bsc_chem" },

            { "value": "oop", "text": "Object-Oriented Programming", "program": "btech_cse" },
            { "value": "networks", "text": "Computer Networks", "program": "btech_cse" },
            { "value": "ai", "text": "Artificial Intelligence", "program": "btech_cse" },

            { "value": "thermo_mech", "text": "Thermodynamics", "program": "btech_mech" },
            { "value": "fluid_mech", "text": "Fluid Mechanics", "program": "btech_mech" },
            { "value": "machine_design", "text": "Machine Design", "program": "btech_mech" },

            { "value": "structural", "text": "Structural Engineering", "program": "btech_civil" },
            { "value": "surveying", "text": "Surveying", "program": "btech_civil" },
            { "value": "geotech", "text": "Geotechnical Engineering", "program": "btech_civil" },

            { "value": "marketing", "text": "Marketing Management", "program": "bba" },
            { "value": "finance", "text": "Financial Accounting", "program": "bba" },
            { "value": "hr", "text": "Human Resource Management", "program": "bba" },

            { "value": "strategic", "text": "Strategic Management", "program": "mba" },
            { "value": "leadership", "text": "Leadership and Ethics", "program": "mba" },
            { "value": "business_analysis", "text": "Business Analytics", "program": "mba" },

            { "value": "economics", "text": "Managerial Economics", "program": "pgdm" },
            { "value": "operations", "text": "Operations Management", "program": "pgdm" },
            { "value": "digital_marketing", "text": "Digital Marketing", "program": "pgdm" },

            { "value": "anatomy", "text": "Human Anatomy", "program": "mbbs" },
            { "value": "physiology", "text": "Physiology", "program": "mbbs" },
            { "value": "pathology", "text": "Pathology", "program": "mbbs" },

            { "value": "oral_bio", "text": "Oral Biology", "program": "bds" },
            { "value": "dental_materials", "text": "Dental Materials", "program": "bds" },
            { "value": "periodontics", "text": "Periodontics", "program": "bds" },

            { "value": "pharmaceutics", "text": "Pharmaceutics", "program": "bpharma" },
            { "value": "pharmacology", "text": "Pharmacology", "program": "bpharma" },
            { "value": "pharma_chem", "text": "Pharmaceutical Chemistry", "program": "bpharma" },

            { "value": "color_theory", "text": "Color Theory", "program": "bfa_paint" },
            { "value": "portrait_painting", "text": "Portrait Painting", "program": "bfa_paint" },
            { "value": "art_history", "text": "Art History", "program": "bfa_paint" },

            { "value": "clay_modelling", "text": "Clay Modelling", "program": "bfa_sculpt" },
            { "value": "stone_carving", "text": "Stone Carving", "program": "bfa_sculpt" },
            { "value": "metal_casting", "text": "Metal Casting", "program": "bfa_sculpt" },

            { "value": "digital_photo", "text": "Digital Photography", "program": "bfa_photo" },
            { "value": "lighting", "text": "Studio Lighting", "program": "bfa_photo" },
            { "value": "photo_editing", "text": "Photo Editing Techniques", "program": "bfa_photo" }
          ],
          "choicesVisibleIf": "{program} = {$item.program}",
          "enableIf": "{program} notempty",
          "placeholder": "Select course...",
          "startWithNewLine": false
        },
        // ...
      ]
    },
    // ..
  ],
  // ...
};

Open in Plunker

New Blog Post

SurveyJS Form Builder: Translation and Localization Made Easy

Bug Fixes and Minor Enhancements

Form Library

  • Dynamic Matrix: displayValue expression function doesn't work if expression column comes before target column (#10697)
  • Expand/collapse doesn't work for Matrices and Multiple Textboxes in input-per-page survey mode (#10656)
  • Expression keywords (e.g., {item}) are incorrectly treated as case-sensitive (#10677)
  • Multi-Select / Dynamic Matrix: SurveyModel's focusQuestion() method doesn't focus the first matrix row (#10657)
  • Specialized question: Exception is thrown when loading an invalid date into a month-type input (#10663)
  • Button captions and action dropdown items do not support Markdown (#10679)

Survey Creator

  • JSON Editor: Question name stays the same after being updated using the Ace Editor's "Find and Replace" feature (#7303)
  • Preview tab: Page selector displays raw Markdown (#7298)
  • Theme Editor: Unexpected error appears in the Opacity editor when changing the backgroundImageFit property (#7276)
  • visibleIf expression updates incorrectly after a referenced element is deleted (#7297)

PDF Generator

  • Image previews use fallback dimensions that distort the original size and break aspect ratio in PDF output (#446)
  • [Node.js] Static survey images cannot be retrieved by their URLs (#448)

How to Update SurveyJS Libraries in Your Application

Angular
npm i survey-core@v2.5.0 survey-angular-ui@v2.5.0 --save
npm i survey-creator-core@v2.5.0 survey-creator-angular@v2.5.0 --save
npm i survey-analytics@v2.5.0 --save
npm i survey-pdf@v2.5.0 --save
React
npm i survey-core@v2.5.0 survey-react-ui@v2.5.0 --save
npm i survey-creator-core@v2.5.0 survey-creator-react@v2.5.0 --save
npm i survey-analytics@v2.5.0 --save
npm i survey-pdf@v2.5.0 --save
Vue.js
npm i survey-core@v2.5.0 survey-vue3-ui@v2.5.0 --save
npm i survey-creator-core@v2.5.0 survey-creator-vue@2.5.0 --save
npm i survey-analytics@2.5.0 --save
npm i survey-pdf@2.5.0 --save
HTML/CSS/JavaScript
<link href="https://unpkg.com/survey-core@2.5.0/survey-core.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/survey-core@2.5.0/survey.core.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/survey-js-ui@2.5.0/survey-js-ui.min.js"></script>

<script src="https://unpkg.com/survey-core@2.5.0/themes/index.min.js"></script>
<script src="https://unpkg.com/survey-creator-core@2.5.0/themes/index.min.js"></script>

<link href="https://unpkg.com/survey-creator-core@2.5.0/survey-creator-core.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/survey-creator-core@2.5.0/survey-creator-core.min.js"></script>
<script src="https://unpkg.com/survey-creator-js@2.5.0/survey-creator-js.min.js"></script>

<link href="https://unpkg.com/survey-analytics@2.5.0/survey.analytics.min.css" rel="stylesheet">
<script src="https://unpkg.com/survey-analytics@2.5.0/survey.analytics.min.js"></script>

<script src="https://unpkg.com/survey-pdf@2.5.0/survey.pdf.min.js"></script>
<script src="https://unpkg.com/survey-pdf@2.5.0/pdf-form-filler.min.js"></script>

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.