DataHub
Updating Parent for Existing Assets

Overview

When importing data repeatedly, existing records may require updates. One common case is moving an Asset between parents when its status changes.

Scenario

Initial Import:

Client-000001 → Parent: Active

Later Import: Client-000001 → Active = FALSE

Expected Result: Client-000001 → moved to Inactive

Example Mutator

return function mutate(sourceData, columnNames, rowObject, connectionData, createError)
{
     const [raw] = sourceData;
 
    if (raw == null || raw === "") {
        createError("Active value is missing");
        return [];
    }
 
    const val = (raw + "").trim().toUpperCase();
 
    if (val === "TRUE") {
        return ["Active"];
    } 
    else if (val === "FALSE") {
        return ["Inactive"];
    } 
    else {
        createError("Invalid Active value: " + raw);
        return null;
    }
}

Important Considerations

  • The connector must allow updates (not insert-only)
  • Parent field must always be included in mapping

Result

  • Existing assets are updated correctly
  • Parent changes are reflected automatically