Dynamic table as source for Table records

Dynamic table as source for Table records

  

Hi All, 

I'm trying to populate a table of records with the output of  sql query , whose output is dynamic. 

i.e., The sql query fetches data from different tables with the table name as input parameter. 

Kindly let me know if there is a way to dynamically display such tables in the screen.


Thanks and Regards,

Priya





Hi Priyadharshini,

The OutSystems Platform does not allow "dynamic" output of a SQL query: you must always specify the exact output structure(s). This output can be used as input to a Table Records.

TableRecord in screen can only shown a limited column anyway.

For example you want to show 5 columns. 

Create a structure with 5 attributes which type set to Text (you need a common data type).

Your sql query must return exactly 5 columns and assigned that structure as output structure.

Not ideal but you could try using the AdvanceQuery extension and then render the results as a HTML table via an expression. We have used that method to produce a simple support tool that lets us view any physical table in the systems.

John Williams wrote:

Not ideal but you could try using the AdvanceQuery extension and then render the results as a HTML table via an expression. We have used that method to produce a simple support tool that lets us view any physical table in the systems.

Thank you John.. I will give a try this way. 


Harlin Setiadarma wrote:

TableRecord in screen can only shown a limited column anyway.

For example you want to show 5 columns. 

Create a structure with 5 attributes which type set to Text (you need a common data type).

Your sql query must return exactly 5 columns and assigned that structure as output structure.


Thank you for the suggestion Harlin. I'm trying to find if there is a way to have dynamic data. As another member just suggested, we will try using advanced query extension. 

Kilian Hekhuis wrote:

Hi Priyadharshini,

The OutSystems Platform does not allow "dynamic" output of a SQL query: you must always specify the exact output structure(s). This output can be used as input to a Table Records.

Hi Kilian Hekhuis, 


Ok sure. Thank you.