Complex Questions in Expressions

Edit in →
Survey Creator

Complex questions can contain more than one value. Such questions include Single-, Multi-Select, and Dynamic Matrices, Dynamic Panels, and Multiple Textboxes questions. This example demonstrates how to access different values within complex questions.

To access a value from outside a complex question, use the question's name and the name of its element (item, row, column) to which the value belongs:

Question Type Syntax
Multiple Textboxes {questionname.itemname}
Single-Select Matrix {questionname.rowname}
Multi-Select Matrix {questionname.rowname.columnname}
{questionname-total.columnname} (accesses a cell in the total row)

This demo shows a Multiple Textboxes question that asks users to enter contact details, including an email address. Under this question, the form displays an "I agree to receive newsletters" checkbox, which is visible only if an email address is provided. This checkbox is a Yes/No (Boolean) question. Its visibleIf expression accesses the email address input field of the Multiple Textboxes question using the notation from the table above.

To access a value (question or cell) within a Dynamic Panel or Dynamic Matrix from outside, use a zero-based index:

Question Type Syntax
Dynamic Panel {dynamicpanelname[index].questionname}
Dynamic Matrix {dynamicmatrixname[rowindex].columnname}

To access a cell or question from inside a matrix or panel, use the row, panel, and parentPanel prefixes:

Question Type Syntax Action
Single-Select Matrix, Multi-Select Matrix, Dynamic Matrix {row.columnname} Accesses a cell in the same row.
{rowName} Accesses the row name (the value property within objects in the rows array). Use this placeholder if you need to distinguish between matrix rows.
Dynamic Panel {panel.questionname} Accesses a question within the same panel.
{parentPanel.questionname} Accesses a question within a parent Dynamic Panel.
Applies when one Dynamic Panel question is nested in another.

In this demo, the row prefix is used to calculate totals in each matrix row and enable or disable the Quantity column cells based on a condition. Refer to the json.js file for code examples.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

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.