Skip to content

Commit

Permalink
Describe setValueIf and setValueExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Tsukanov committed Oct 5, 2023
1 parent 87c19f7 commit 4ea7812
Showing 1 changed file with 17 additions and 0 deletions.
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

0 comments on commit 4ea7812

Please sign in to comment.