Unify and manage your data

Partial overrides

Learn about using a partial override to change parts in an entity or in a relationship.

Use the partial override option only when you update an entity with the Entities. If this option is present, then only attributes that are provided in a request will be overwritten. It’s useful if you need to update only part of an entity's attributes.

The default partialOverride behavior can be extended by more business logic for nested attributes. For more information, see topics enableNestedPartialOverride option and keyAttributesURI options.

Examples

Existing Entity

{
  "uri": "entities/0001L5U",
  "type": "configuration/entityTypes/HCP",
  "createdBy": "test.user",
  "createdTime": 1459517575543,
  "updatedBy": "test.user",
  "updatedTime": 1459517575659,
  "attributes": {
    "FirstName": [
      {
        "type": "configuration/entityTypes/HCP/attributes/FirstName",
        "ov": true,
        "value": "Value2",
        "uri": "entities/0001L5U/attributes/FirstName/1n5QlE"
      },
      {
        "type": "configuration/entityTypes/HCP/attributes/FirstName",
        "ov": true,
        "value": "Value1",
        "uri": "entities/0001L5U/attributes/FirstName/1n5MUy"
      }
    ],
    "LastName": [
      {
        "type": "configuration/entityTypes/HCP/attributes/LastName",
        "ov": true,
        "value": "LastName1",
        "uri": "entities/0001L5U/attributes/LastName/1n5V1U"
      }
    ]
  },
  "isFavorite": false,
  "crosswalks": [
    {
      "uri": "entities/0001L5U/crosswalks/1n5ZHk",
      "type": "configuration/sources/FB",
      "value": "entity1",
      "reltioLoadDate": "2016-04-01T18:32:55.267+05:00",
      "createDate": "2016-04-01T18:32:55.267+05:00",
      "updateDate": "2016-04-01T18:32:55.267+05:00",
      "attributes": [
        "entities/0001L5U/attributes/FirstName/1n5QlE",
        "entities/0001L5U/attributes/LastName/1n5V1U",
        "entities/0001L5U/attributes/FirstName/1n5MUy"
      ],
      "singleAttributeUpdateDates": {}
    }
  ],
  "label": "Value2 LastName1",
  "secondaryLabel": ""
}

Overwrite Without partialOverride Option

POST {tenantUrl}/entities
  
[
  {
    "type": "configuration/entityTypes/HCP",
    "attributes": {
      "FirstName": [
        {
          "value": "Value1New"
        }
      ]
    },
    "crosswalks": [
      {
        "type": "configuration/sources/FB",
        "value": "entity1"
      }
    ]
  }
]

Now, the resulting entity has only one attribute now: FirstName with one value. LastName is deleted during the overwrite, because it wasn’t present in the request JSON.

Result

{
  "uri": "entities/0001L5U",
  "type": "configuration/entityTypes/HCP",
  "createdBy": "test.user",
  "createdTime": 1459517575267,
  "updatedBy": "test.user",
  "updatedTime": 1459517689925,
  "attributes": {
    "FirstName": [
      {
        "type": "configuration/entityTypes/HCP/attributes/FirstName",
        "ov": true,
        "value": "Value1New",
        "uri": "entities/0001L5U/attributes/FirstName/1n5qKm"
      }
    ]
  },
  "isFavorite": false,
  "crosswalks": [
    {
      "uri": "entities/0001L5U/crosswalks/1n5ZHk",
      "type": "configuration/sources/FB",
      "value": "entity1",
      "reltioLoadDate": "2016-04-01T18:34:49.925+05:00",
      "createDate": "2016-04-01T18:32:55.267+05:00",
      "updateDate": "2016-04-01T18:32:55.267+05:00",
      "attributes": [
        "entities/0001L5U/attributes/FirstName/1n5qKm"
      ],
      "singleAttributeUpdateDates": {}
    }
  ],
  "label": "Value1New",
  "secondaryLabel": ""
}

Overwrite with partialOverride option.

POST {tenantUrl}/entities?options=partialOverride
  
[
  {
    "type": "configuration/entityTypes/HCP",
    "attributes": {
      "FirstName": [
        {
          "value": "Value1New"
        }
      ]
    },
    "crosswalks": [
      {
        "type": "configuration/sources/FB",
        "value": "entity1"
      }
    ]
  }
]

In this case, the LastName attribute wasn’t deleted. However, the FirstName attribute also has only one value, because it was taken into the overwrite operation, as it was present in the request JSON and there was only one value in it. If you need to save the second value, then you must specify it in the request JSON.

Results

{
  "uri": "entities/0001L5U",
  "type": "configuration/entityTypes/HCP",
  "createdBy": "test.user",
  "createdTime": 1459517575267,
  "updatedBy": "test.user",
  "updatedTime": 1459517956024,
  "attributes": {
    "FirstName": [
      {
        "type": "configuration/entityTypes/HCP/attributes/FirstName",
        "ov": true,
        "value": "Value1New",
        "uri": "entities/0001L5U/attributes/FirstName/1n6o0O"
      }
    ],
    "LastName": [
      {
        "type": "configuration/entityTypes/HCP/attributes/LastName",
        "ov": true,
        "value": "LastName1",
        "uri": "entities/0001L5U/attributes/LastName/1n6WxM"
      }
    ]
  },
  "isFavorite": false,
  "crosswalks": [
    {
      "uri": "entities/0001L5U/crosswalks/1n5ZHk",
      "type": "configuration/sources/FB",
      "value": "entity1",
      "reltioLoadDate": "2016-04-01T18:39:16.024+05:00",
      "createDate": "2016-04-01T18:32:55.267+05:00",
      "updateDate": "2016-04-01T18:32:55.267+05:00",
      "attributes": [
        "entities/0001L5U/attributes/FirstName/1n6o0O",
        "entities/0001L5U/attributes/LastName/1n6WxM"
      ],
      "singleAttributeUpdateDates": {}
    }
  ],
  "label": "Value1New LastName1",
  "secondaryLabel": ""
}