How can I create this query with builder

result like this without split formatter

  • message: "Array to string conversion",

  • trace: "#0 [internal function]: exception_error_handler(8, 'Array to string...', 'C:\xampp\htdocs...', 79, Array) #1 C:\xampp\htdocs\hao2\dmxConnectLib\lib\db\Connection.php(79): PDOStatement->bindParam(1, 'Array', 2) #2 C:\xampp\htdocs\hao2\dmxConnectLib\modules\dbconnector.php(67): lib\db\Connection->execute('SELECT * FROM `...', Array) #3 C:\xampp\htdocs\hao2\dmxConnectLib\lib\App.php(159): modules\dbconnector->select(Object(stdClass), 'query1') #4 C:\xampp\htdocs\hao2\dmxConnectLib\lib\App.php(128): lib\App->execSteps(Object(stdClass)) #5 C:\xampp\htdocs\hao2\dmxConnectLib\lib\App.php(98): lib\App->execSteps(Array) #6 C:\xampp\htdocs\hao2\dmxConnectLib\lib\App.php(71): lib\App->exec(Object(stdClass)) #7 C:\xampp\htdocs\hao2\dmxConnect\api\test\AA.php(8): lib\App->define(Object(stdClass)) #8 {main}"

have you tried to convert bb to string?

yeap I tried …

{{(query2.values()).toString()}}

{{query2.values().toString()}}

A little confused because i am not seeing the repeat in there, so strange

From your first screenshot where you added the repeat, you have Database Query: urunler
Then a repeat called repeat1 which has the expression of urunler set to it
Then no set value step at all
Then Database Query: rezervasyonlar

So with this situation i would leave the urunler query as you have it but turn OUTPUT to off
leave the repeat as you have it bu make sure OUTPUT is set to on
change the condition on rezervasyonlar to urunid > not in > {{repeat1}}
This way you should not need the split at all, but when you click the lightening bolt on the rezervasyonlar query condition you should see the repeat

is the error in query1 or query2?

the secondary query where you have the condition, the problem is that the condition should be set to the output of the repeat not the output of a SetValue or the first query, the only way you could get the values from the set value step is if the set value step was also in the repeat step.

query2 return all of available rooms … but returned results like this

{

* query2: [
  * {
    * urun_id: 33},

  * {
    * urun_id: 51},

  * {
    * urun_id: 46}]

}

but query 1 needs to 33,51,46

select * from events where urun_id in (33,51,46)

problem , returned results are not 33,51,46

Sorry is query 1 urunler and query 2 rezervasyonlar

yes query 1 is urunler and query 2 rezervasyonlar

english :
query 1 all rooms
query 2 all events (booking details )

Do you want the results of query1 ( all rooms ) or query2 (booking details)

yes of course.

still confused which one, has to return results from one OR the other
do you want the returned results to be from the query1 table

OR

do you want the returned results to be from the query 2 table

as i understand repeat will not work.
he want all the result of one query to filter the other query

yeap firsth query return all booked ids… then I want to use them in second query

will converting the column work?
query2.urun_id.toString()

@mrbdrm
its not work … I tried

hmm I see, but surely that would work if you repeat all results from the first query and then add them all to the repeat so they all land up in an array, then on the second query it says only return results that are not in the first query.

I have to wonder if this would be better as an inner join rather with both tables in a single query and the inner join operator is set to not equal

i thought about this solution
doing a repeat and adding the values to a variable. then doing the second query but that is just too much for something surly simple :sweat_smile:

Can you try this, make a new server action, have your database connection step then have a database query step, no repeat step or setvalue

in the query add two tables, your events table first, then your urunler table second, a popup box will appear, leave alias blank and join type to inner join and you can choose on the left side the ID field, then an operator of NOT EQUAL then on the right you will have the second ID field from the urunler table, do not set any conditions at all, and see what that returns please

ok . no problem …