Skip to main content

Virtual Fields

A virtual field is a purely input field whose value may or may not be provided at creation, used to trigger a change in one or more fields that depend on it.

  • It must have one or more dependent fields depending on it.
  • It must have a validator.
  • It may also have a re-validator.
  • It may have an alias - a different field name on the input struct, used in place of the actual field name (only allowed if the corresponding output field is a dependent field that directly depends on this virtual field).
  • It may have a sanitizer.
  • It may leverage ignore, ignore_init and ignore_update provision rules.
  • It may have on_failure and on_success event handlers.

Examples

Try it in the browser

virtual_field is a virtual input field. The output dependent uses its value when provided, otherwise it falls back to a default. Leave virtual_field empty or remove it to see the default.

Loading playground…