Create this Query in Wappler


#61

image
Response for me is still:
{"aa":["30","16","11"]}

code_value_id is numeric in DB. Don’t know why its coming as string. I see output for you is numbers.
Are you using .NET or PHP? I am using .NET with MySQL 8.0 odbc driver.


#62

I’m using PHP.


#63

Must be IIS related then.
@patrick can you please check this?


#64

It’s strange that the results are being returned as text. Is that definitely an issue with the array conversion or is that how the results are returned by the first query? Also, I think the query should work even if the numbers are in quotes, so perhaps there is another issue.


#65

Amazing @George

Exactly what i asked for many months ago


#66

NishKarsh, did you try NOT editing the file and just adding the {{queryname.groupBy(‘id’).keys()} into the query editor conditions as above, worked perfectly for me


#67

I deleted the edited server action. Made this from scratch and added the groupby in condition and set value.

Yeah… quotes is probably not the issue.


#68

Shot in the dark, try {{query1.groupBy(“id”).keys().toNumber()}}?


#69

Error: Can not convert Array to Double. :sweat_smile:


#70

which stage is generating the error, i am not having the same issues as you,

query1 (get exceptions)
query2 get results condition NOT IN {{query1.groupBy(“id”).keys()}} and {{query1.groupBy(“id”).keys().toNumber()}} both work via the visual builder for me?


#71

The condition in query is generating error.
The group by itself is working, but when used in condition parameter for NOT IN, it says Cannot convert array to string.
I am able to print the value of group by using set value, so I know that part is working.

Are you testing this on IIS with MySQL too?


#72

Was testing on Apache/Mysql, will re-test on my local IIS (Server 2012 R2) and report back


#73

No errors on IIS/PHP/ MySQL at my end


#74

MySQL driver version?


#75

PM sent with config info link


#76

Some drivers don’t return the results correctly and numbers can be returned as string. Using them in the query should be no problem, most databases don’t matter if you pass the variable as number or string, they will convert it to the correct type. So id = 1 and id = '1' both will work the same.

@nshkrsh What is the query2 you now have, did you use the aa value for the NOT IN condition?


#77

Yes. Tried it with aa and writing the query with formatter directly too.


#78

Do you get an error now, what is the result? Also when the result is incorrect, enable the Debug in the select action, this will output the query and parameters used.

image


#79

The error is:

Messaging you a link to check the debug output.


#80

An update for the community: The groupby conversion issue was specific to IIS/.NET.
Patrick fixed the code & it was probably released in 1.9.7.
So, after the amazing & lengthy discussion, the original query has been successfully created in Wappler. :slight_smile: