Can you return CUSTOM query output as an OBJECT not an ARRAY?

Hey All

I’m building some queries into a JSON output that needs to go into an API request, and when I’ve used the standard query builder I’ve been able to use the ‘Single Query’ option to change the output from an array to an object (i think that’s the right terminology :slight_smile: )

So from this:

"json":[{
 "date":"2019-01-01T00:00:00.000Z",
 "calls":2006
}]

To this:

"json":{
 "date":"2019-01-01T00:00:00.000Z",
 "calls":2006
}

The problem is that I need to use a custom query for a couple of reasons (in the above, its to cast the format for the date as the default returned in the query isn’t accepted in the API)

But I don’t know how to replicate the same option with the standard queries to have it retun the data as an object rather than an array?

Any thoughts?

I’ve read a bit about JSON PATH but not sure how it fits in with Wappler and PostgreSQL.

Community Page
Last updated: