# Copy data between each other by keys

**URL:** <https://forum.alumio.com/t/copy-data-between-each-other-by-keys/517>\
**Category:** General\
**Created:** [March 18, 2023, 1:48pm UTC](https://forum.alumio.com/t/copy-data-between-each-other-by-keys/517 "2023-03-18T13:48:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![abubakar](https://forum.alumio.com/letter_avatar_proxy/v4/letter/a/8491ac/32.png) [@abubakar](https://forum.alumio.com/u/abubakar)\
**Post date:** [March 21, 2023, 10:38am UTC](https://forum.alumio.com/t/copy-data-between-each-other-by-keys/517/3 "2023-03-21T10:38:21Z")

</div>

Let me rephrase then

I possess the following object and need to remove any elements(wProductVariations. **attributes** ) from wProductVariations that do not match the attributes object at the root level:

```auto
{
  "attributes": [
    {
      "id": 1,
      "option": "SMALL"
    },
    {
      "id": 2,
      "option": "White"
    }
  ],
  "wProductVariations": [
    {
      "id": 2237,
      "attributes": [
        {
          "id": 1,
          "option": "XX-Large"
        },
        {
          "id": 2,
          "option": "White"
        }
      ],
      "menu_order": 0,
      "meta_data": [
        {
          "id": 56685,
          "key": "_wc_additional_variation_images",
          "value": ""
        }
      ]
    },
    {
      "id": 2236,
      "attributes": [
        {
          "id": 1,
          "option": "X-Large"
        },
        {
          "id": 2,
          "option": "White"
        }
      ]
    },
    {
      "id": 2235,
      "attributes": [
        {
          "id": 1,
          "option": "Large"
        },
        {
          "id": 2,
          "option": "White"
        }
      ]
    },
    {
      "id": 2234,
      "attributes": [
        {
          "id": 1,
          "option": "Medium"
        },
        {
          "id": 2,
          "option": "White"
        }
      ]
    },
    {
      "id": 2233,
      "attributes": [
        {
          "id": 1,
          "option": "Small"
        },
        {
          "id": 2,
          "option": "White"
        }
      ]
    }
  ]
}

```

hope this is clear now? Thanks in advance

---

_[View the full topic](https://forum.alumio.com/t/copy-data-between-each-other-by-keys/517)._
