Quote from
luishp on September 14, 2024, 8:16 pm
@kajanken neoSqlJson is an asynchronous command. It takes time and once it has finished calls a callback subroutine.
You are not waiting for the command to finish so [mydata] is allways undefined.
Try this instead:
LoadJSON "https://jsonplaceholder.typicode.com/todos" [myjson]
SetVar [myquery] "select * from ? where id < 3"
neoSqlJson [myjson] [myquery] [mydata] ""
Wait 300
ConsoleLog [mydata]
EndWait
As you can see I have just included a wait of 300 milliseconds, but it's better to use a callback function instead.
Let me know if you need additional assistance.
Regards,
@kajanken neoSqlJson is an asynchronous command. It takes time and once it has finished calls a callback subroutine.
You are not waiting for the command to finish so [mydata] is allways undefined.
Try this instead:
LoadJSON "https://jsonplaceholder.typicode.com/todos" [myjson]
SetVar [myquery] "select * from ? where id < 3"
neoSqlJson [myjson] [myquery] [mydata] ""
Wait 300
ConsoleLog [mydata]
EndWait
As you can see I have just included a wait of 300 milliseconds, but it's better to use a callback function instead.
Let me know if you need additional assistance.
Regards,
kajanken has reacted to this post.