title: Send Array List through Query Parameters on HTTP Request and IN operator-Mule 4
body: <p>I am sending array list of Query params through HTTP request
  Array list id's <code>[1234,3442,9489,9498]</code> </p>
  
  <pre><code>    &lt;http:request method="GET" config-ref="HTTP_Request_configuration" 
       path="${p.path}"&gt;
      &lt;http:query-params&gt;&lt;![CDATA[#[output application/java
      ---    {"id" : payload  }]]]&gt;
     &lt;/http:query-params&gt;
  </code></pre>
  
  <p>I am getting following error:</p>
  
  <blockquote>
    <p>Error: java.util.ArrayList cannot be cast to > java.lang.String</p>
  </blockquote>
  
  <p>Note: if i send them through for each, its working as expected. But i would like to pass them as list through  query string params using <code>IN</code> operator in database</p>
  
  <p>select Query: </p>
  
  <pre><code>   &lt;flow name="query database"  &gt; 
  &lt;set-variable value="#[attributes.queryParams.'id']" doc:name="ID"   variableName="ID"/&gt;
  &lt;db:select doc:name="Get data"  config-ref="Db Connection"&gt;
    &lt;db:sql &gt;
     SELECT * from Mytable where id in ( :Ref) &lt;/db:sql&gt;
                  &lt;db:input-parameters &gt;&lt;![CDATA[#[{
                      Ref: vars.ID
                  }]]]&gt;&lt;/db:input-parameters&gt;
  
      &lt;/db:select&gt;
  </code></pre>
  
  <p>Workaround: Array list is converted to <code>1234,3442,9489,9498</code>  using dataweave function <code>reduce($+$$)</code>, yet returning error</p>
  
  <p>Any ideas on how to pass array list with coma seperated values through query params and using them in <code>IN</code> clause of DB query</p>
  
  <blockquote>
    <p>Edit: (payload joinBy ", ") as String helped me pass these values as
    string, Also changed type in RAML.</p>
  </blockquote>
  
  <p>Now, how can i pass these values to DB to <code>IN</code> clause</p>