Visibility rules can be used to build a better user experience when filling out fields by showing and hiding only the relevant fields.
Visibility rules have the following common settings:
|
Setting Name |
Description |
|---|---|
|
Rule Name |
Name for the visibility rule that is used in the admin panel and status windows. |
|
Success Action |
Perform this action when a “Success” result is returned from the rule. |
|
Failure Action |
Perform this action when a “Failure” result is returned from the rule. |
Visibility actions:
|
Action |
Description |
|---|---|
|
Hide |
Hide the field. Has no effect if the field is already hidden. |
|
Show |
Show the field. Has no effect if the field is already hidden. |
|
Toggle |
If the field is currently hidden then it will be shown. If the field is currently shown then it will be hidden. |
|
None |
Has no effect on the fields visibility. |
Toggling the advanced option will then expose the following settings:
|
Setting Name |
Description |
|---|---|
|
Skip if successful |
Name for the visibility rule that is used in the admin panel and status windows. |
|
Skip if failure |
Perform this action when a “Success” result is returned from the rule. |
Comparison
Comparison rules can be used to compare fields against other fields or static values.
The rules are configured using a “left value vs right value” design pattern.
The following comparisons are available:
|
Comparison |
Description |
|---|---|
|
Equals |
Returns a “Success” if the left value exactly matches the right value. Returns a “Failure” if they don't. |
|
Not equals |
Returns a “Success” if the left value is different from right value. Returns a “Failure” if they are the same. |
|
Contains |
Returns a “Success” if the left value is contains a partial match on the right value. Returns a “Failure” if it does not. |
|
Starts with |
Returns a “Success” if the left value starts with the right value. Returns a “Failure” if it does not. |
|
Ends with |
Returns a “Success” if the left value ends with the right value. Returns a “Failure” if it does not. |
|
Is blank |
Returns a “Success” if the left value is an blank or and empty string. Returns a “Failure” if it isn’t |
|
Is not blank |
Returns a “Success” if the left value contains any value. Returns a “Failure” if it doesn’t. |
|
Any (Array) |
Returns a “Success” if the right value exactly matches any of the values in the left value (which is an array). Returns a “Failure” if there is no matches. |
|
None (Array) |
Returns a “Success” if the right value doesn’t match any of the values in the left value (which is an array). Returns a “Failure” if there is an exact match. |
In order to add multiple comparison rules in an “AND/OR” fashion you must toggle Advanced Mode.
Query
The query visibility rule can be used to execute a query against one of the supported providers.
Field values are able to be referenced via the standard fields placeholder.
When using the following providers please note the following:
ODBC/SQL/Authority Server
-
The query returning no rows will make the visibility rule return a “failure”.
-
The query returning one row with multiple columns will make the visibility rule return a “success”.
-
The query returning one row with a single column will evaluate the following:
-
A value of empty string or null will make the validation rule fail.
-
A value of “false” will make the visibility rule return a “failure”.
-
A value of “true” will make the visibility rule return a “success”.
-
Any other value will make the visibility rule return a “success”.
-
Sample Table (DocMatrix):
|
DocType |
ShowComments |
ShowDateRecieved |
ShowAmount |
ShowSecurity |
|---|---|---|---|---|
|
Invoice |
true |
true |
true |
false |
|
General Correspondence |
true |
true |
false |
false |
|
Classified Agreement |
false |
true |
false |
true |
Sample Query:
|
Description |
Query |
|---|---|
|
Determine if a field (Comments should show based on the DocType of “Invoice“ Because the query returns the text “true” the “success” action would be performed. |
|
EzeScan WebApps Placeholders
-
The placeholder returning the string “false” will make the visibility rule return a “failure”.
-
The placeholder returning the string “true” will make the visibility rule return a “success”.
-
The placeholder returning an empty value will make the visibility rule return a “failure”.
-
The placeholder returning a value that is not “false” will make the visibility rule return a “success”.
-
The placeholder returning a false boolean will make the visibility rule return a “failure”.
Sample Placeholders:
|
Description |
Placeholder |
|---|---|
|
Field value equals “123” |
|
|
Field value starts with “INV” |
|
|
Field value greater than “5” |
|
|
Field value equals the value of a field with id “other_field” |
|