Report on a different field if the first field is empty

You can use the USER_SYM_SUBROUTINE subroutine with the TWO.FIELDS argument in a complex User Symbolic to choose another field if the first field is empty.

Subroutine name

USER_SYM_SUBROUTINE

Subroutine argument

TWO.FIELDS

Field type

All fields

Examples of use

If your collection has social history and natural history collection items, you likely use different fields. You could report on Name/Title field (social history objects) and if there was no information in that field, this user symbolic will instead report on the Classification field (natural history specimens).

Argument syntax and parameters

The subroutine is a piece of code that uses ‘arguments’. An argument is a set of options that tells the subroutine what to do. The argument parameters are commonly separated by an exclamation mark.

The TWO.FIELDS subroutine argument structure is:

TWO.FIELDS!arg2!arg3

What the argument parameters mean

Argument parameter Required or optional? Explanation
arg2 Required Internal field name of first field to check.
arg3 Required Internal field name of second field to check. That is, if there is no data in the first field, use the data from this field instead.
arg4 Optional

Flag to indicate whether to apply a display conversion on each field. The default is no conversion.

Set to 1 to apply a conversion. For example, convert authority term IDs to their term names.

Example of subroutine argument

This argument will report on the Name/Title field first, but if no data is entered in the Name/Title field, it will report on the Classification field instead. The Classification display name will appear because the display conversion has been enabled.

TWO.FIELDS!NAME!CLASSIFICATION!1