Empty Flag


Basically, every field (in the source and target structure) has a value (i.e. at least an empty string "").

In addition, each value has a so-called Empty Flag. The Empty Flag in is a property that tells whether a value is to be considered as empty (in the sense of non-existent) regardless of whether the value represents an empty string (so there are empty strings with and without Empty Flag and also concrete values with Empty Flag, as we will see later).

Note: Strictly speaking, a value has an Empty Flag and a field has a value. For the sake of simplicity, however, we speak of a field with an Empty Flag. If the Empty Flag of the value of a field is true, then we say the field has an Empty Flag and if the Empty Flag of the value of a field is "false", we say the field has no Empty Flag.

Origin


Source structure


  • If for example, the input format "XML" is used and the input data is missing a tag (which corresponds to a source field), the source field receives an empty string and the Empty Flag. The same applies to a "CSV" source structure with x fields if the input file only contains x-1 fields. The last field of the source structure is then given an empty string and the Empty Flag.

  • In this context, option "Treat empty value as not existing" ("Phase 2,/Extended settings") plays a role. If the option is set and the input data for a source structure field (data type "CSV") contains only an empty string, then an empty string and the Empty Flag is set for the source field. If the option is not set, only the empty string is set, but not the Empty Flag.

  • A further special case can be found in the section "Hidden values" below.

Target structure


  • No source structure field is assigned to a target structure field (i.e. it is not mapped). The target structure field also contains no functions and no fixed value. In this case, the target structure field receives an empty string and the Empty Flag.

  • A source structure field is assigned to a target structure field (i.e. it is mapped). The target structure field also contains no functions and no fixed value. In this case, the target structure field receives the value and the Empty Flag of the source structure field (if it has one).

  • Explicit setting of the Empty Flag for a target structure field with function "set empty flag()". The function sets an empty string and the Empty Flag.

  • There are a number of other functions that can set an Empty Flag. Please refer to the respective function documentation.

Check for Empty Flag


You can use the function "get empty flag()" to check whether the Empty Flag is set for a (source or target structure) field.

Hidden values


Hidden means that fields with these values are displayed with "no value" in the mapping test, but internally there is a value that is only not visible because of the set Empty Flag. Hidden values can occur in the following ways.


  • A field of the source structure has the type "Date" and the parser could not successfully parse the value of the input data for this field into a date using the field's template. In this case, the source field receives the current date and the Empty Flag. In the mapping test, you will get "no value" displayed (the log of the test, however, will show the assignment of the current date). As mentioned above, a mapped target structure field will also get this hidden value and the Empty Flag.

  • If a field of the target structure uses one of the functions "create date strict()", or "date-from-excel()", the current date and the Empty Flag are also set if no valid date can be generated with the value and template specified in the function.

  • As result value of some functions if they get a hidden value as an input value. Please refer to the respective function documentation.

  • Explicitly using the "set empty flag()" function.

Effect of Empty Flag and hidden values


  • In a generated output file, usually, no value is output for a target field with an Empty Flag. However, there are also exceptions where the output of these values can be forced (see option "With empty fields" in the XMLNoTemplateUnit for example). This can be relevant for hidden date values. Please refer to the documentation for the respective output type/components.

  • In a mapping test, a field with a set Empty Flag is displayed with no value (in the source structure and the target structure).

  • The function "get empty flag()" returns "true" (for source and target structure fields). This would not happen if the field had the value "" (i.e. an empty string, meaning a string of length "0") and no Empty Flag.

  • There are also functions that allow hidden values as input parameters. One example is function "concat()"shall be mentioned here. Please also refer to the respective function documentation. If field values are added to a list, hidden values may be written into the list. See function "add to list(unique value a, name of list b, [skip empty c])", for example.

  • In SQL statements in phase 4, values with the Empty Flag set can be skipped.