The FIELDTYPE field function returns the type of a given field.
FIELDTYPE returns an integer representing the type of the field identified by source_field_reference; this is the type of the field, not the data type of the field that the parameter identifies. If the parameter identifies a nonexistent entity, NULL is returned.
The mapping of integer values to field types is not published, and might change from release to release. Compare the results of the FIELDTYPE function with named field types.
IF FIELDTYPE(source_field_reference) = NameValue THEN ...
FIELDTYPE(SomeFieldReference) IS NULL
IF FIELDTYPE(InputRoot.XML.Message1.Name) IS NULL THEN // Name field does not exist, take error action.... ... more ESQL ... ELSE // Name field does exist, continue.... ... more ESQL ... END IF