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

Describe setValueIf and setValueExpression #7082

Merged
merged 1 commit into from
Oct 5, 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
17 changes: 17 additions & 0 deletions src/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,7 @@ export class Question extends SurveyElement<Question>
*
* An expression can also include built-in and custom functions for advanced calculations. For example, if the `defaultValue` should be today's date, set the `defaultValueExpression` to `"today()"`, and the corresponding built-in function will be executed each time the survey is loaded. Refer to the following help topic for more information: [Built-In Functions](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#built-in-functions).
* @see defaultValue
* @see setValueExpression
*/
public get defaultValueExpression(): any {
return this.getPropertyValue("defaultValueExpression");
Expand All @@ -1650,19 +1651,35 @@ export class Question extends SurveyElement<Question>
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see setValueIf
*/
public get resetValueIf(): string {
return this.getPropertyValue("resetValueIf");
}
public set resetValueIf(val: string) {
this.setPropertyValue("resetValueIf", val);
}
/**
* A Boolean expression. If it evaluates to `true`, the question value is set to a value calculated using the [`setValueExpression`](#setValueExpression).
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see resetValueIf
*/
public get setValueIf(): string {
return this.getPropertyValue("setValueIf");
}
public set setValueIf(val: string) {
this.setPropertyValue("setValueIf", val);
}
/**
* An expression used to calculate the question value. Applies only when the [`setValueIf`](#setValueIf) expression evaluates to `true`.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see defaultValueExpression
* @see resetValueIf
*/
public get setValueExpression(): string {
return this.getPropertyValue("setValueExpression");
}
Expand Down
Loading