Generate a chart from a dynamic sql input

We are trying to generate a chart from a dynamic SQL input.

Ex: we have an input and the user writes a select, the result of that select, if valid, is shown in a chart.

We have no problems if the data is pre-defined since we already know the output structure, but if in this case since the input is dynamic we dont know the output until the user runs the query.

Is there a way to achieve this?

Margarida Almeida wrote:

We are trying to generate a chart from a dynamic SQL input.

Ex: we have an input and the user writes a select, the result of that select, if valid, is shown in a chart.

We have no problems if the data is pre-defined since we already know the output structure, but if in this case since the input is dynamic we dont know the output until the user runs the query.

Is there a way to achieve this?

Hi Margarida,

Can you elaborate what exactly your dynamic SQL. 

Thanks..... 


Hi Margarida,

Did you search the forum first?  this question is answered allready in some posts.

Basically you can do it by generating the output in JSON using SQL clauses from the underlying database.

You can create an advance query that returns JSON using  "FOR JSON AUTO". 

https://www.outsystems.com/forums/discussion/39250/sql-output-entities-structures-is-there-a-way-to-be-more-ge

https://www.outsystems.com/forums/discussion/41275/suggestions-dynamic-output-entities-or-structure/

https://www.outsystems.com/forums/discussion/50498/dynamic-structure/

Regards,

Daniel