SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = {Customers}
ORDER BY ORDINAL_POSITION
I am using above query for getting only attribute names from entity .I have used same query in mysql database there it is working and getting list of only column names of table.but i dont know how to use in outsystems
{Table}.[Attribute]
Select Column_Name FROM {Table}
WHERE {Table}.[Name] = @Customer
ORDER BY {Table}.[Position]
This is not working .I want all attribute name from entity for example
User is entity and having id,name, email ,mobile attributes .these are the attributes and i want these attribute list in excel , meaning it will return only name of attribute not data
Hi,
You don't need an SQL, you can do it with an aggregate around the correct system entity.
Regards, Daniel
Hi, a little late to discussion but i tried getting the data from entity and entity_attr seperately and downloading the data through a excel download button i see that the data doesn't make sense at all. No column inside the sheet is matching what my entities have and their attributes. Is there another way, perhaps? Can you suggest how to use sql here if possible?
@Satvik Srivastava ,
Hope you are doing well.
I believe that's the best way to get the list of attributes, and I am sure you have implemented the above solution correctly, however can you let me know you implemented it?
You can follow the below approach.
My entity is test in espace 123
SELECT * FROM ossys_Entity WHERE NAME = 'test' and espace = 123
this will give the id of the entity
SELECT * FROM ossys_Entity_Attr WHERE ENTITY_ID = 456
Let me know if that helps
https://success.outsystems.com/Documentation/How-to_Guides/Data/How_to_Export_Entity_Data_to_Excel i followed this and the table of entities looks like this:-
Similarly for entity_attr table and for the sql code i have over 100 entities in my application , i don't want to write the query 100 times for same thing, anyway to optimise it
Hi Manisha,
To get the Columns names instead of SQL query you can use dynamic tables.
hi Manisha Pardhe
you used record to excel widget in sever side pass the list of aggregate and select all the attributes.
it return binary file assign with output (binary type) and download this file.
@Manisha Pardhe You can use an aggregate to fetch data from the Customers table. If you wanna see only Customer names on the excel sheet, then select the Customer Name attribute as showed in the screenshot:
You can check my oml below as well.
Kind Regards,
Tami