Query using IN clause

======== TEMPLATE BUG FORM ========

Wappler Version : 2.1.5
Operating System : Centos 7 / php 7.2

Expected behavior

Using a query action, the query in question should return 11 rows from the database.

The query should be:
SELECT tran, id, gl, amount, source_date FROM distros WHERE tran IN (30,1,33,32,34,2,3,4,5,39) AND instance = 2) ORDER BY source_date DESC

This shows the query results using Sequel Pro:

Actual behavior

The query returns two rows.

Here is the debug from the query

Here is the output:

Here is the query action:

and the paged query that provides the id’s for the IN clause:

How to reproduce

The id values used in the IN clause shown above come from a paged query action. It appears as though only the first item in the list is used in the subsequent query, although the debug shows the entire list.

Hello,
Can you please attach a screenshot of the query builder, where we can see what have you configured in the UI?

The query with the IN clause:


Here is the paged query:

The IN value must be an array.

Thanks @Teodor

How can I get the array value from the previous paged query?

I want the array to be a list of the id field from queryTrans.

EDIT: I figured it out:

{{queryTrans.data.groupBy(‘id’).keys()}}

1 Like

Thanks for the solutions @mebeingken

1 Like