# The set ingest processor converts json to string

**URL:** <https://discuss.elastic.co/t/the-set-ingest-processor-converts-json-to-string/245625>\
**Category:** Elasticsearch\
**Created:** [August 19, 2020, 2:46pm UTC](https://discuss.elastic.co/t/the-set-ingest-processor-converts-json-to-string/245625 "2020-08-19T14:46:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BkQc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkqc/32/73699_2.png) [@BkQc](https://discuss.elastic.co/u/BkQc)\
**Post date:** [August 19, 2020, 2:46pm UTC](https://discuss.elastic.co/t/the-set-ingest-processor-converts-json-to-string/245625/1 "2020-08-19T14:46:20Z")

</div>

Hello,  
I have an array of objecs that I create in a temporary field on my document.  
I then want to use the value from that temporary field in place of the actual value of another field (originally an array of string).  
When I use the Set processor, my Json is converted to a plain String.

Why is it doing this and how can I have it do what I'm looking for?

Notes:  
I already tried to use the convert processor but there is no object type.  
I also tried to use the JSON processor but for some reason, it doesn't recognize the string.

---

<div class="post-metadata">

**Author:** ![BkQc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkqc/32/73699_2.png) [@BkQc](https://discuss.elastic.co/u/BkQc)\
**Post date:** [September 15, 2020, 5:31pm UTC](https://discuss.elastic.co/t/the-set-ingest-processor-converts-json-to-string/245625/2 "2020-09-15T17:31:15Z")

</div>

Instead, I used a script processor and directly called the add method of the Array.

```
{
  "script": {
    "if": "true",
    "lang": "painless",
    "source": "ctx.MyArray.add(ctx.UnityEntry)"
  }
}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 13, 2020, 5:31pm UTC](https://discuss.elastic.co/t/the-set-ingest-processor-converts-json-to-string/245625/3 "2020-10-13T17:31:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
