Start page / Template development / Rules / Comparative expressions / <NULL/>/<NOT_NULL/>

<NULL/>/<NOT_NULL/>: (Not) null check in dynamic forms

Input components may contain a value or may be “empty”. If no value is stored in the input component, this can return either an:

depending on the type of component.

The <NULL/> and <NOT_NULL/> tag can be set in the value determination area of the rule definition (or for the definition of a precondition) and checks whether an input component contains a value

  • <NULL/>: If the input component contains
    • a value, a check with <NULL/> returns FALSE
    • no value, a check with <NULL/> returns TRUE
  • <NOT_NULL/>: If the input component contains
    • a value, a check with <NOT_NULL/> returns TRUE
    • no value, a check with <NOT_NULL/> returns FALSE

The check always refers to the value of an input component. To this end, it is also necessary to add a <PROPERTY/> tag (with the value attribute) inside the <NULL/> / <NOT_NULL/> tag.

Important For input components that contain an empty value, which is the case for the FirstSpirit text input components, for instance, the <NOT_NULL/> check also returns TRUE.
To prevent storing the empty values, the <PROPERTY/> tag can be used in conjunction with the empty attribute for the check instead of <NOT_NULL/>.
Important Special conditions also apply to input components for which a default value has been added within the form template (more on this subject).

Examples

1) Displaying a note as long as a component has not been filled yet

As long as the editor has not selected anything in the combo box, the FirstSpirit framework highlights the input component in the workspace in color (see Display in the working area) and displays a note.

The SAVE restriction also prevents saving of the form.

<RULES>
<RULE>
<WITH>
<NOT_NULL>
<PROPERTY source="st_combobox" name="VALUE"/>
</NOT_NULL>
</WITH>
<DO>
<VALIDATION scope="SAVE">
<PROPERTY source="st_combobox" name="VALID"/>
<MESSAGE lang="*" text="&quot;Not Null&quot; comparison"/>
<MESSAGE lang="DE" text="&quot;Not Null&quot;-Prüfung"/>
</VALIDATION>
</DO>
</RULE>
</RULES>

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.4 | Data privacy