On Change: Difference between revisions
Marek Rodak (talk | contribs) No edit summary |
Marek Rodak (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
{{WIP}} | {{WIP}} | ||
==On Change rule== | ==On Change rule== | ||
The On Change rules are checked when any field is modified. Rules are client-side scripts that are executed when a user of the mobile app interacts with the app. Rules are no-code business logic, which are managed using the rules editor, usually in Woodford. | The On Change rules are checked when any field is modified. Rules are client-side scripts that are executed when a user of the mobile app interacts with the app. Rules are no-code business logic, which are managed using the rules editor, usually in Woodford. | ||
| Line 18: | Line 17: | ||
==Forms== | ==Forms== | ||
On change rule on form usually serves as a simple field validation. | |||
;Rule execution | |||
*When you modify any field. | *When you modify any field. | ||
*When form is loaded (a new form starts empty, then the values are changed as they are loaded from the database and displayed). | *When form is loaded (a new form starts empty, then the values are changed as they are loaded from the database and displayed). | ||
| Line 29: | Line 27: | ||
==Form Examples== | ==Form Examples== | ||
===Example: Postal code validation=== | |||
===Example | |||
When a user enters information into a field, you may want to verify that the format is correct. | When a user enters information into a field, you may want to verify that the format is correct. | ||
For example, postal code filed validation based on expected format. | For example, postal code filed validation based on expected format. | ||
[[File:Postal code validation.png|600px]] | [[File:Postal code validation.png|600px]] | ||
==Views== | |||
On Change rule is applicable only when Editable field is set. (Editable field, list, or editable grid is a feature that allows users to edit more records at once, directly from the view, without a need to go to edit form of a record.) In view designer select a filed which you want to make editable, then in Properties pane - Cell section, change Kind to Edit or DirectEdit type. | |||
;Rule execution | |||
*When you modify any field. | |||
*When view is loaded (a new form starts empty, then the values are changed as they are loaded from the database and displayed). | |||
==Questionnaires== | |||
;Rule execution | |||
*When any value in the questionnaire is modified | |||
*When questionnaire IsLoaded=true (a new questionnaire starts empty, then the values are changed as they are loaded from the database and displayed). | |||
*When a repeatable group is repeated | |||
*When a repeatable group is deleted | |||
==Questionnaire Examples== | |||
===Example: Additional questions=== | |||
When a user answers a question in a certain way, you may want to display additional questions. For example, if the answer to question “Are you married?” is “Yes”, additional question “Partners name” is set to be visible. | |||
[[File:Additional question.png|600px]] | |||
===Example: Automated date of next inspection=== | |||
When a user answers a question in a certain way, you might want to change the other questions. For example, you can count the next inspection date based on the periodicity of inspections. | |||
[[File:Automated date of next inspection.png|600px]] | |||
Revision as of 10:36, 18 July 2022
| Warning | Work in progress! We are in the process of updating the information on this page. Subject to change. |
On Change rule
The On Change rules are checked when any field is modified. Rules are client-side scripts that are executed when a user of the mobile app interacts with the app. Rules are no-code business logic, which are managed using the rules editor, usually in Woodford.
On Change rules are available for the following user interface components:
- Forms
- Editable views
- Questionnaires
- Schedule Board
IsLoaded
IsLoaded is a variable, property which checks whether the form or questionnaire is fully loaded and visible on the screen, with all the values assigned. For example, you can use it to differentiate between the initial loading of a form and manual user change.
| IsLoaded | Equals | True |
Forms
On change rule on form usually serves as a simple field validation.
- Rule execution
- When you modify any field.
- When form is loaded (a new form starts empty, then the values are changed as they are loaded from the database and displayed).
- When an associated/related record is created or modified - it has to be set up in the properties of an associated list. Open Properties of associated list and in Properties section check Trigger OnChange event option.
- Setting a value inside the On Change rule for a field placed on the form triggers the On Change rule again.
Form Examples
Example: Postal code validation
When a user enters information into a field, you may want to verify that the format is correct. For example, postal code filed validation based on expected format.
Views
On Change rule is applicable only when Editable field is set. (Editable field, list, or editable grid is a feature that allows users to edit more records at once, directly from the view, without a need to go to edit form of a record.) In view designer select a filed which you want to make editable, then in Properties pane - Cell section, change Kind to Edit or DirectEdit type.
- Rule execution
- When you modify any field.
- When view is loaded (a new form starts empty, then the values are changed as they are loaded from the database and displayed).
Questionnaires
- Rule execution
- When any value in the questionnaire is modified
- When questionnaire IsLoaded=true (a new questionnaire starts empty, then the values are changed as they are loaded from the database and displayed).
- When a repeatable group is repeated
- When a repeatable group is deleted
Questionnaire Examples
Example: Additional questions
When a user answers a question in a certain way, you may want to display additional questions. For example, if the answer to question “Are you married?” is “Yes”, additional question “Partners name” is set to be visible.
Example: Automated date of next inspection
When a user answers a question in a certain way, you might want to change the other questions. For example, you can count the next inspection date based on the periodicity of inspections.