core:delete (Delete individual elements)

See also: core:clear (Delete all entries from a list)

As XML attribute

With the control attribute core:delete individual elements (e.g. attributes or positions) can be deleted from a data item by Import.

The attribute must always be assigned to the element to be deleted.

As with updating, the element in question must be unambiguously identified for it to be effectively deleted. Depending on the element type, this may be achieved by various methods as illustrated the examples below.

NOTE◄ If the Import specifies the control attribute core:delete for an element that does not yet exist as a data item, it is not created by the Import. This technique is used, for example, to completely clear Plural attributes (see examples for core:clear (Delete all entries from a list)).

NOTE◄ In simple lists that do not support unique access to the contained entries, entries cannot be individually updated or deleted. Such lists can only be completely cleared and refilled using core:clear (see core:clear (Delete all entries from a list)). This concerns, for example, the enumerations for roles (roles) and companies (companies) for a user.

As XML node

In addition, core:delete can also be used as a node whose text value contains the name of the field to be 'deleted'. There can be several core:delete nodes in one hierarchy level.
The node variant is needed to explicitly set simple fields of a business object to zero. This would not be easily possible since fields with empty or null values are ignored by an import in UPDATE mode.
Furthermore, fields with numeric type would be converted to 0 by the _data Integration Unit.
Example: <core:delete>attributes</core:delete> Deletes all attributes of a business object.

NOTE◄ Fields marked with core:delete nodes are reset regardless of the value of the associated field. Thus, only the visibility of the core:delete node decides whether the field is reset or not.

Example 1: Removing a typed attribute identified by type

An order includes the date attribute 'Fixed delivery date'. An Import should remove values for this attribute under certain conditions (for example, because a cancellation is flagged by the leading system). This condition can be defined by assigning the value true or false to the attribute field core:delete_attr in the mapping for the import profile by a suitable function.

The Import shown on the right uses the action UPDATE.

  • In the search node only indicated here, the relevant order must be clearly identified by a search.


  • An OrderDate element (date attribute) appears in the attributes node, giving the core:delete attribute the value true.


<?xml version="1.0" encoding="UTF-8"?>
<core:Import ... action="UPDATE">
<search> ... </search>
<ord:Order>
<attributes>
...
<ord:OrderDate core:delete="true">
<value dateType="DELIVERY_FIXED">
</value>
</ord:OrderDate>
...
</attributes>
</ord:Order>
</core:Import>

CAUTION◄ While it is irrelevant for the execution of the Import profile whether the date attribute is available in the purchase order, the profile is terminated with an error message if the specified Date types is unknown in Lobster Data Platform / Orchestration.

Example 2: Removing an order item identified by 'Pos. no'.

An Import shall remove the first entry for a certain Line item type ('service item' with the internal prefix SER) from an order.

The Import shown on the right uses the action UPDATE.

  • In the search node (not presented in detail here), the relevant order must be unambiguously identified by a search.


  • The lineItems node contains a lineItem element that assigns the value true to the core:delete attribute, referring to the lineItemId 'SER1'.

The first 'service item' is deleted, if available.

<?xml version="1.0" encoding="UTF-8"?>
<core:Import action="UPDATE">
<search> ... </search>
<ord:Order>
...
<lineItems>
<lineItem core:delete="true" lineItemId="SER1">
</lineItem>
</lineItems>
</ord:Order>
</core:Import>

Example 3: Removing an entry identified by index for a plural attribute

An Import shall remove the second entry for the plural text attribute 'Container No.' from a purchase order.

The Import shown on the right uses the action UPDATE.

  • In the search node only indicated here, the relevant order must be unambiguously identified by a search.


  • The attributes node contains a text attribute (OrderText) of the CONTAINER_NO type that assigns the value true to the attribute core:delete and whose value should have the index '1' (starting with 0).

The second 'Container No.' is deleted, if available.

<?xml version="1.0" encoding="UTF-8"?>
<core:Import ... action="UPDATE">
<search> ... </search>
<ord:Order>
<attributes>
<ord:OrderText core:delete="true">
<value index="1" textType="CONTAINER_NO"></value>
</ord:OrderText>
</attributes>
</ord:Order>
</core:Import>

NOTE◄ Instead of the index, which is explicitly featured as an XML-attribute for the values of plural attributes, you could also refer to the internal index per core:index attribute. However, the index value must then be assigned within the attribute node itself and not the value subnode:

<?xml version="1.0" encoding="UTF-8"?>
<core:Import ... action="UPDATE">
<search> ... </search>
<ord:Order>
<attributes core>
<ord:OrderText core:delete="true" core:index="1">
<value textType="CONTAINER_NO"></value>
</ord:OrderText>
</attributes>
</ord:Order>
</core:Import>

Example 4: Reset/delete the value of a simple object field

The Import XML shown on the right searches for and updates an order and resets the value of the field "numberOfPackages" to zero.

This is not possible without using <core:delete>, since empty or null field values are ignored in UPDATE mode.
In addition, field values of numeric types are set to 0 by the _data IU, if their value is empty or zero.

<?xml version="1.0" encoding="UTF-8"?>
<core:Import ... action="UPDATE">
<search> ... </search>
<ord:Order>
<core:delete>numberOfPackages</core:delete>
</ord:Order>
</core:Import>