Skip to content

Commit

Permalink
updated survey-library docs [azurepipelines skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed Dec 10, 2024
1 parent 100cf45 commit d74e8ee
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ A string value that specifies the property type. Accepts one of the values descr
| `"dropdown"` | Drop-down menu | Use this type to allow respondents to select from a set of predefined options. Requires a defined [`choices`](#choices) array. |
| `"buttongroup"` | A group of related buttons | Use this type to allow respondents to select from a small set of predefined options (typically, no more than three). Requires a defined [`choices`](#choices) array. |
| `"boolean"` | Checkbox | Use this type for Boolean values. |
| `"condition"` | Multi-line text input with an optional dialog window | Use this type for [Boolean expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility) similar to [`visibleIf`](https://surveyjs.io/form-library/documentation/api-reference/question#visibleIf) or [`enableIf`](https://surveyjs.io/form-library/documentation/api-reference/question#enableIf). |
| `"expression"` | Multi-line text input with a hint icon | Use this type for non-Boolean [expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions). |
| `"condition"` | Multi-line text input with an optional dialog window | Use this type for [Boolean expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility) similar to [`visibleIf`](https://surveyjs.io/form-library/documentation/api-reference/question#visibleIf) or [`enableIf`](https://surveyjs.io/form-library/documentation/api-reference/question#enableIf). Requires an implemented [`onExecuteExpression`](#onexecuteexpression) function. |
| `"expression"` | Multi-line text input with a hint icon | Use this type for non-Boolean [expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions). Requires an implemented [`onExecuteExpression`](#onexecuteexpression) function. |
| `"number"` | Text input | Use this type for numeric values. |
| `"spinedit"` | Text input with increase and decrease buttons | Use this type for integer values. |
| `"text"` | Multi-line text input | Use this type for multi-line text values. |
Expand Down
36 changes: 28 additions & 8 deletions docs/design-survey-conditional-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can use the following values as placeholders:

### Question Values

To use a question value as a placeholder, specify the question's [`name`](https://surveyjs.io/Documentation/Library?id=Question#name) in curly brackets. The name will be replaced with the question value. For instance, the following example defines two [Text](https://surveyjs.io/Documentation/Library?id=questiontextmodel) questions: First Name and Last Name. An [Html](https://surveyjs.io/Documentation/Library?id=questionhtmlmodel) question uses their `name` property to reference them and display their values:
To use a question value as a placeholder, specify the question's [`name`](https://surveyjs.io/Documentation/Library?id=Question#name) in curly brackets. The name will be replaced with the question value. For instance, the following example defines two [Single-Line Input](https://surveyjs.io/Documentation/Library?id=questiontextmodel) questions: First Name and Last Name. An [HTML](https://surveyjs.io/Documentation/Library?id=questionhtmlmodel) question uses their `name` property to reference them and display their values:

```js
const surveyJson = {
Expand All @@ -40,7 +40,7 @@ const surveyJson = {

> For questions with a specified [`valueName`](https://surveyjs.io/form-library/documentation/api-reference/question#valueName) property, use its value instead of the `name` value.
In single- and multiple-selection question types (Dropdown, Checkbox, Radiogroup, Tag Box, Image Picker), items can contain a display value in addition to a question value. In this case, placeholders are replaced with display values. If you want to use question values instead, disable the [`useDisplayValuesInDynamicTexts`](https://surveyjs.io/form-library/documentation/api-reference/question#useDisplayValuesInDynamicTexts) property.
In single- and multiple-selection question types (Dropdown, Checkbox, Radio Button Group, Tag Box, Image Picker), items can contain a display value in addition to a question value. In this case, placeholders are replaced with display values. If you want to use question values instead, disable the [`useDisplayValuesInDynamicTexts`](https://surveyjs.io/form-library/documentation/api-reference/question#useDisplayValuesInDynamicTexts) property.

Certain question types can contain multiple values. Use a dot symbol to access a specific value (item or cell):

Expand Down Expand Up @@ -72,14 +72,34 @@ Certain question types can contain multiple values. Use a dot symbol to access a
</table>
</div>

[View Demo](/Examples/Library?id=condition-complexquestions (linkStyle))
[View Demo](https://surveyjs.io/form-library/examples/use-and-represent-complex-questions-in-expressions/ (linkStyle))

In dynamic questions, use a zero-based index to access a specific value (question or cell):
In question types whose value is an array, you can use zero-based indexes to access a specific item, question, or cell:

| Question Type | Syntax |
| ---------------------------------------------------------------------- | ------------------------------------------ |
| [Dynamic Panel](/Documentation/Library?id=questionpaneldynamicmodel) | `{dynamicpanelname[index].questionname}` |
| [Dynamic Matrix](/Documentation/Library?id=questionmatrixdynamicmodel) | `{dynamicmatrixname[rowindex].columnname}` |
<div class="v2-class---doc-table-container">
<table class="v2-class---doc-table-container__table">
<thead>
<tr>
<th>Question Type</th>
<th>Syntax</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model" class="v2-class---paragraph-link">Checkboxes</a>, <br><a href="https://surveyjs.io/form-library/documentation/api-reference/image-picker-question-model" class="v2-class---paragraph-link">Image Picker</a>, <br><a href="https://surveyjs.io/form-library/documentation/api-reference/multiple-text-entry-question-model" class="v2-class---paragraph-link">Multiple Textboxes</a>, <br><a href="https://surveyjs.io/form-library/documentation/api-reference/ranking-question-model" class="v2-class---paragraph-link">Ranking</a></td>
<td style="vertical-align:middle"><code>{questionname[index]}</code></td>
</tr>
<tr>
<td><a href="/Documentation/Library?id=questionpaneldynamicmodel" class="v2-class---paragraph-link">Dynamic Panel</a></td>
<td style="vertical-align:middle"><code>{dynamicpanelname[index].questionname}</code></td>
</tr>
<tr>
<td><a href="/Documentation/Library?id=questionmatrixdynamicmodel" class="v2-class---paragraph-link">Dynamic Matrix</a></td>
<td style="vertical-align:middle"><code>{dynamicmatrixname[rowindex].columnname}</code></td>
</tr>
</tbody>
</table>
</div>

You can also use prefixes, such as `row`, `panel`, and `parentPanel`, to access a specific question or cell relative to the question you configure:

Expand Down

0 comments on commit d74e8ee

Please sign in to comment.