# Replace values with a value in another value

**URL:** <https://forum.alumio.com/t/replace-values-with-a-value-in-another-value/1121>\
**Category:** Data Transformers\
**Created:** [May 13, 2024, 1:27pm UTC](https://forum.alumio.com/t/replace-values-with-a-value-in-another-value/1121 "2024-05-13T13:27:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.wiegmann](https://forum.alumio.com/user_avatar/forum.alumio.com/j.wiegmann/32/1570_2.png) [@j.wiegmann](https://forum.alumio.com/u/j.wiegmann)\
**Post date:** [May 13, 2024, 1:27pm UTC](https://forum.alumio.com/t/replace-values-with-a-value-in-another-value/1121/1 "2024-05-13T13:27:39Z")

</div>

Hi all,

I have an object containing the following data:

```auto
"EF000003":{
 "Value":"EV010173"
 "Datatype":"picklist"
 "InternationalCharacteristicCode":"EF000003"
 "Description":"Montagewijze"
 "orderNumber":5
 "Unit":""
 "newValue":{
  "EV000028":"Universeel"
  "EV008457":"Op kabelgoot"
  "EV010173":"Wand-/plafondmontage"
  "EV011419":"op het centrale vak"
 }
}

```

I need to replace the string in Value with the actual value that corresponds in newValue. In this example, this should be the outcome:

```auto
"EF000003":{
 "Value":"Wand-/plafondmontage"
 "Datatype":"picklist"
 "InternationalCharacteristicCode":"EF000003"
 "Description":"Montagewijze"
 "orderNumber":5
 "Unit":""
}

```

Any easy way to achieve this?

---

<div class="post-metadata">

**Author:** ![catalin](https://forum.alumio.com/user_avatar/forum.alumio.com/catalin/32/1428_2.png) [@catalin](https://forum.alumio.com/u/catalin)\
**Post date:** [May 13, 2024, 7:13pm UTC](https://forum.alumio.com/t/replace-values-with-a-value-in-another-value/1121/2 "2024-05-13T19:13:57Z")

</div>

Hey @j.wiegmann  
The simplest way this could be done is to intersect it by that value(EV010173), since its the only common ground with objects inside the “newValue”.  
Make a new key value pair, so you can use the Operator, Array Intersect keys, even if you have two objects to compare, it will still work.  
something like:

```auto

  "setPathToTake": {
    "EV010173": "EV010173"
  }
}

```

When intersecting it will only get the object with the same key and all the data, the expected result is the example you provided.

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/8/836dbb97b10d47b8291bf1325865505feda76ded.png)  
See transformer for full example.  
[export\_20240513220924.ndjson](https://forum.alumio.com/uploads/short-url/frDpBsw6z3IOT0akDusNKz6InfQ.ndjson) (1.4 KB)

---

<div class="post-metadata">

**Author:** ![j.wiegmann](https://forum.alumio.com/user_avatar/forum.alumio.com/j.wiegmann/32/1570_2.png) [@j.wiegmann](https://forum.alumio.com/u/j.wiegmann)\
**Post date:** [May 14, 2024, 12:02pm UTC](https://forum.alumio.com/t/replace-values-with-a-value-in-another-value/1121/3 "2024-05-14T12:02:15Z")

</div>

Thank you very much. I had not used the Array Intersect option yet!
