Here are the input JSON files:

**input.json**

```
[
   {
      "Id":"123456"
   },
   {
      "Id":"7890123"
   }
]

```

**array.json**

```
[
   {
      "DataId":"{{ID}}"
   },
   {
      "DataId":"{{ID}}"
   }
]

```

I try to replace placeholders in array JSON with IDs from the input file and create new array of objects.

This is what I have come up with so far:

```
cat input.json | jq '.[] as $inputs |[ $endFile[] + {"DataId": $inputs[]}] ' --argjson endFile "$(<array.json)"

```

I am getting the duplicates and I have no clue, why:

```

    **[**
     **{**
    **"DataId"****:** "123456"
     **},**
     **{**
    **"DataId"****:** "123456"
     **}**
    **]**
    **[**
     **{**
    **"DataId"****:** "7890123"
     **},**
     **{**
    **"DataId"****:** "7890123"
     **}**
    **]**

```

I need to have the same structure as the array.json only with values.

Thank you!