Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions: Describe the displayValue() and propertyValue() functions #6961

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/design-survey-conditional-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,30 @@ Returns the total number of items in an array taken from a given question proper

[View Source Code](https://github.com/surveyjs/survey-library/blob/68eb0054dc83d2f45a6daa1042bf7440c8faf007/src/functionsfactory.ts#L189-L196 (linkStyle))

---

#### `displayValue`

*Definition*: `displayValue(questionName: string): any`

Returns a question's display text. Supports questions nested within panels or matrices.

*Example*: `"expression": "displayValue('question1')"`

[View Source Code](https://github.com/surveyjs/survey-library/blob/f70cd9a367659f475e28e0a317b9583931cdf185/src/functionsfactory.ts#L359-L363 (linkStyle))

---

#### `propertyValue`

*Definition*: `propertyValue(questionName: string, propertyName: string): any`

Returns the value of a property specified for a given question. Supports questions nested within panels or matrices.

*Example*: `"expression": "propertyValue('question1', 'visible')"`

[View Source Code](https://github.com/surveyjs/survey-library/blob/f70cd9a367659f475e28e0a317b9583931cdf185/src/functionsfactory.ts#L365-L370 (linkStyle))

### Custom Functions

In addition to [built-in functions](#built-in-functions), expressions can use custom functions. They allow you to extend the functionality of your survey.
Expand Down