Jump to content

On Load: Difference between revisions

From Resco's Wiki
Marek Rodak (talk | contribs)
Tag: visualeditor
No edit summary
Line 1: Line 1:
{{Rules TOC}} {{WIP}} __FORCETOC__
{{Rules TOC}} {{WIP}}
The '''On Load rules''' are checked when you open a form or a questionnaire. 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 Load rules''' are checked when you open a form or a questionnaire. 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]].
OnLoad rules are the best option when it comes to handling initializations. They are designed and should be used for various steps handling actions connected to initialization of components or form styles. By setting up only the initialization actions in On Load rule, its execution time is minimal.
 
On Load rules are the best option when it comes to handling initializations. They are designed and should be used for various steps handling actions connected to the initialization of components or form styles. By setting up only the initialization actions in On Load rule, its execution time is minimal.


On Load rules are available for the following [[user interface components]]:
On Load rules are available for the following [[user interface components]]:
Line 7: Line 8:
*[[Questionnaire Designer|Questionnaires]]
*[[Questionnaire Designer|Questionnaires]]


===Set up in OnLoad rule:===
== Set up in On Load rule ==


*Hide/Show fields
* Hide/show fields
*Enable/Disable fields
* Enable/disable fields
*Hide/Show form tabs
* Hide/show form tabs
*Assign styles to fields or to the entire form
* Assign styles to fields or to the entire form
*Automatically assign values to fields, e.g. date & time, location, company number etc.
* Automatically assign values to fields, e.g. date & time, location, company number, etc.


Do not set up Hide/Show/Enable/Disable fields and tabs dynamically. The actions related to changes on a form while working with it are better to set up in the [[On Change]] rule.
Do not set up hide/show/enable/disable fields and tabs dynamically. The actions related to changes on a form while working with it are better set up in the [[On Change]] rule.
 
== Forms ==
 
You can use these rules for example to apply a custom format to certain records.


==Forms==
Form rules describe sequences of steps that are executed on form-related events. You can use these rules for example to apply custom format to certain records.
;Rule execution
;Rule execution
* When when you open a form.


*When when you open a form.
=== Example: Hide email field ===
 
===Example: Hide E-mail Field===


If the field Don’t Allow Emails is set to true, make Email field not visible on the form.
If the field Don’t Allow Emails is set to true, make Email field not visible on the form.
Line 29: Line 31:
[[File:Hide email field.png|600px]]
[[File:Hide email field.png|600px]]


==Questionnaires==  
== Questionnaires ==  
 
[[Questionnaire Designer#Editing rules|Editing rules]] allow you to further customize the questionnaire form’s design and usage (hide or disable form fields, assign values to them, etc.).


[[Questionnaire Designer#Editing rules|Editing rules]]
allow you to further customize the questionnaire form’s design and usage (hide or disable form fields, assign values to them, etc.).
;Rule execution
;Rule execution


Line 38: Line 40:
*When a repeatable group is repeated.
*When a repeatable group is repeated.


===Example:Automatically filled fields===
=== Example: Automatically filled fields ===


You might want that some fields are automatically filled in when a user starts the questionnaire.
You might want that some fields are automatically filled in when a user starts the questionnaire.


[[File:Rules example.png|600px]]
[[File:Rules example.png|600px]]

Revision as of 06:35, 20 July 2022

Warning Work in progress! We are in the process of updating the information on this page. Subject to change.

The On Load rules are checked when you open a form or a questionnaire. 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 Load rules are the best option when it comes to handling initializations. They are designed and should be used for various steps handling actions connected to the initialization of components or form styles. By setting up only the initialization actions in On Load rule, its execution time is minimal.

On Load rules are available for the following user interface components:

Set up in On Load rule

  • Hide/show fields
  • Enable/disable fields
  • Hide/show form tabs
  • Assign styles to fields or to the entire form
  • Automatically assign values to fields, e.g. date & time, location, company number, etc.

Do not set up hide/show/enable/disable fields and tabs dynamically. The actions related to changes on a form while working with it are better set up in the On Change rule.

Forms

You can use these rules for example to apply a custom format to certain records.

Rule execution
  • When when you open a form.

Example: Hide email field

If the field Don’t Allow Emails is set to true, make Email field not visible on the form.

Questionnaires

Editing rules allow you to further customize the questionnaire form’s design and usage (hide or disable form fields, assign values to them, etc.).

Rule execution
  • When when you open a questionnaire.
  • When a repeatable group is repeated.

Example: Automatically filled fields

You might want that some fields are automatically filled in when a user starts the questionnaire.