135
Views
2
Comments
Generate a chart from a dynamic sql input
Question

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?

2020-06-27 18-35-53
Rohan Hanumante

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..... 


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

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


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.