Create structure based on query results

Create structure based on query results

  
Is it possible to create a structure to store output in based on a (previous) query result?

eg,

I have measurement values in a table, with timestamps and measurement-point ID's

If an ID is added (during import), It is added to the table without problems. I would like to display these different points next to each other, in matrix form. (horizontally measurement-points, vertically the timestamps)

Any ideas on how to do this?
Hey,

You can store the output of a query in a structure if you use advanced query's.
Create a structure in you aplication then assign it to your advanced query.
Hello Luis (and others),

the problem is, I don't know the structure at compile-time, only at run-time.

For example, in the code, I would create a query that is being executed. This generated query has an unknown number of columns.

Something like an AddColumn action that would add an extra column/field to a structure would work.

In the end, I want to create a matrix from a table to export to excel.

I'm starting on an extension that converts a table to a matrix, and exports to excel.
Hello Hans de Vries,

I dont know if the new versions of Outsystems support dynamic output structures since im not updated with them yet, but i guess not.
You can always use the Wishlist forum and suggest it.
Hi,

Using an advanced query, you can CONCATENATE columns with some special split char like # then store the output with a TEXT structure (one column).



SELECT region_name + ' #' + store_name FROM Geography
;


**TEXT STRUCTURE**


LISBON#STORE001


LISBON#STORE002

LISBON#STORE003

PORTO#STORE008


SELECT region_name + ' #' + store_name + '#' + store_phone_number FROM Geography <
;



**TEXT STRUCTURE**

LISBON#STORE001#0035198987787

LISBON#STORE002#0035198987987

LISBON#STORE003#0035198998787

PORTO#STORE008#0035198987787



You can also append both lists...



**TEXT STRUCTURE**

LISBON#STORE001

LISBON#STORE002

LISBON#STORE003

PORTO#STORE008

LISBON#STORE001#0035198987787

LISBON#STORE002#0035198987987

LISBON#STORE003#0035198998787

PORTO#STORE008#0035198987787



Now you can manipulate the output results with split function (c# IntegrationStudio) using the char # as separator.

Version 4.2 doesn´t support dynamic AddColumn.

Best Regards,
Rafael Pereira