Data Connector import rule fails to set a foreign key correctly
search cancel

Data Connector import rule fails to set a foreign key correctly

book

Article ID: 156751

calendar_today

Updated On:

Products

IT Management Suite Asset Management Suite

Issue/Introduction

When using a Data Connector import rule, a foreign key is attempting to be set in the "Data class mappings" section. For example, the Ownership Details > Owner data class, for an Asset Owner. When the Import Rule is ran, the Asset Owner is not updated as expected.

Environment

ITMS 8.x

Cause

The Update Mode of the data class is set incorrectly.

Resolution

Ensure that the Update Mode for the data class is set correctly to enable it to update foreign keys. The Update Mode has three settings:

  • Update (default). This should normally be used for any data class that is single rowed. For example, Asset Owner is usually a single rowed data class, but can have multiple ownerships if this has been changed (not default). If this is used with multi rowed data classes, this could result in duplicates or incorrect values.
  • Append. Append adds additional values after the current value for multi rowed data classes. This should not be used for single rowed data classes. For example, Asset Owner is normally a single rowed data class. Setting the Update Mode to Append would attempt to add a second (and so on) Asset Owner. This will result in no changes to the current Asset Owner unless the Asset Owner is set to have multiple ownerships, and then a second (and so on) Asset Owner will then be added. For multiple line items, such as for purchase orders, this should be used. Note: Importing multiple line items for the same resource, such as multiple line items for a specific purchase order, will result in what appears to be errors:

    Row x skipped for data class "Purchase Order Information". Multiple rows of data for the same resource are redundant for single-rowed data class.

    This is normal, and can be ignored. The imported multi-lined purchase order should successfully have all line items brought in via the import rule.
     
  • Replace. This replaces the current value with the new value. This will work similarly to Update and can be used for a single rowed data class, such as Asset Owner.

For example, the following error will occur if a foreign key is attempted to be used without the Update Mode set to Append:

Error: Row x skipped for data class 'Cost Items'. Multiple rows of data for the same resource is not allowed while using Update mode on a data class without key columns.
Solution: For multi rowed records, the Update Mode usually will need to be changed from Update to Append, to enable multiple updates to occur correctly.

Additional Information

155139 Import Rule fails to set or removes Asset Owner or Cost Center

156966 How to troubleshoot import issues when using a Data Connector Import Rule