Using external entity

Using external entity

I'm new to OUTSystems. I'm sorry for an easy question this may be...

I'm trying to use an SQL external database. Following the help instructions, ("Add an external entity to an eSpace"), I've done line 2 ("Upload the eSpace."), and I'm stuck in line 3 ("Select the eSpace where you want to add the entity and edit it."). I can't see nowhere how can I edit the eSpace... And next line is "Press the Add entity to eSpace button.". Where is that button? Can anyone help me?

Maybe this one is easy...


First this is not an easy question at all. Don't ever be sorry to ask if you can't find the answer in documentation. :-)
What I think you are trying to do is to use a foreign entity.

1 - In OutSystems Database, create the table or the view for the foreign entity. Something like:
CREATE VIEW ExternalTableView AS
SELECT * FROM OPENDATASOURCE('SQLOLEDB', 'Data Source=ServerName;User ID=MyUID;Password=MyPass').Northwind.dbo.Categories
You'll need some knowledge and administration privileges in SQL Server also.
See: SQL Server Books\Accessing and Changing Relational Data\Distributed Queries

2 - Declare the foreign entity in OutSystems Service Center.
a. Login in OutSystems Service Center; you must have the "Allow external entities" permission.
b. In the Foreign entities tab, press the Create New Entity button.
c. Specify the name of the entity, the description and the name of the physical table (or view).
d. Create the attribute of the entity and specify its properties.
e. Repeat step 2d for each attribute of the foreign entity.

3 - Add the foreign entity to your eSpace.
See: OutSystems Service Studio Help\Integrating with other systems\External Entities\Using an external entity\Use a foreign Entity

4 - You may not see all the options in Service Center if you are not an administrator and you do not have permissions for this.

If you need further assistance please let us know.
Thanks Tiago. I've read all that doc and much more... :-)

Yes, I'm using admin account, and I've checked all the permissions are set.
I have the external database created thru SQL server. It's already built, so I think I don't need to build it again.
What I'd like to do, is use that external SQL database in eSpace.
I suppose what you mean is to create a new external database from within OutSystems, but I have it already built.

You'll need to redefine the entity structure in a Service Center foreign entity.

With the attached unsupported command line tool you can create a foreign entity definition file (*.ENT) which can be used to upload the definition to Service Center faster
Hi there Tiago,

I'm using the version 5.0 and i need to use a view. I've tried the instructions mentioned above and i can't find the "Foreign Entities" tab.

Can you please help me. Is there another way to use a VIEW in my eSpace?

Pedro Domingues
Hi Pedro,

That was a really old topic :).
Now, to connect to an external database table (or view) you can use Integration Studio.To see how to do that take a look into this post:

Tiago Simões