# Convert object type data to array in Elastic search watcher

**URL:** <https://discuss.elastic.co/t/convert-object-type-data-to-array-in-elastic-search-watcher/357597>\
**Category:** Elasticsearch\
**Created:** [April 17, 2024, 9:49am UTC](https://discuss.elastic.co/t/convert-object-type-data-to-array-in-elastic-search-watcher/357597 "2024-04-17T09:49:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonREC](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JasonREC](https://discuss.elastic.co/u/JasonREC)\
**Post date:** [April 17, 2024, 9:49am UTC](https://discuss.elastic.co/t/convert-object-type-data-to-array-in-elastic-search-watcher/357597/1 "2024-04-17T09:49:27Z")

</div>

Hi,

I am trying to run a Elasticsearch watcher, but I am stuck in the chain input,

I have a http fetch -\> transfrom the http response data -\> used by the index search

the http response data is simply a json like this ["1","9","7","1","7"]

when I pass it to index search query it automatically convert to something like this

```auto
"body": {
                "query": {
                  "bool": {
                    "must": {
                      "terms": {
                        "labels.project_id": [
                          "{0=1, 1=9, 2=7, 3=1, 4=7}"
                        ]
                      }
                    }
                  }
                }
              }
            }

```

I expect it simply be a normal array like ["1","9","7","1","7"], is there any way to convert it back to normal array?

below is my full query for the input part

```auto
"input": {
    "chain":{
      "inputs":[
        {
          "first":{
            "http":{
              "request" : {
              "host" : "test.com",
       
              "path" : "/prod/tasks" ,
               "scheme": "https",
        "port": 443
            }
            }
          }
        },{
          "second":{
            "transform" : {
            "script" : "return ['ids': ctx.payload.first.projectId]"
          }
          }
        },{
          "third":{
            "search":{
              "request":{
                "indices":["lu-traces-apm"],
                "body":{
                  "query":{
                    
                   "bool":{
                     
                      "must":{
                           "terms":{
                           "labels.project_id": ["{{ctx.payload.second.ids}}"]
                    }
                      }
                    }
                   
                }
                }
              }
            }
          }

```
