Data Model Introspection
Stable Version 1.0.0 (OutSystems 9)
Published on 21 September 2015 by 
Created on 21 September 2015
Introspection of You APP datamodel
Read More


At the end of 2015 next step, someone from the audience asked about how can we introspect the data model and find out to which entity and primary key a foreign key belongs to.

Although I did not have an answer at the time I was convinced this would be possible. We have plenty of examples where the platform does this but mainly they are inside the development tool. 

At first glance the system entities did not reveal any obvious connection between entities, primary and foreign keys.

Data Model

The data model is fairly strait forward. A module has many entities which have many attributes.

The Espace_Entity  identifies which entities are referenced on your module. 

Primary Keys

Besides the traditional integer auto number primary key ID you have probably noticed some SS_Key attributes. These are GUID like and also represent a unique way of identifying a record.

Notice how the Entity has a PrimaryKey_SS_Key attribute, this will allow you to identify from the Entity which of its attributes is the Primary Key.(Entity.PrymaryKey_SS_Key = Entity_Attr.SS_Key)

Foreign Key Data Type

On the Entity_Attr notice the Type. This attribute represents the type of the entity attribute (rtText, rtBoolean, rtInteger, etc).

However if you do a select distinct on these types you'll notice some types that look like  this:


·       The bt indicate this is a foreign key

·       The 478870b9-2d60-4f73-9eb3-7cd8b994a737 is the module (espace) SS_Key who own this entity

·       The * is a separator

·       The d028b5ef-4477-4e37-9fa2-cddd7e0e7146 represents the entity

This allows us to identify that this attribute if of type entity identifier, which module, which entity.

Combining this with how to identify primary keys in entities and we have reached our goal. 

Attributes Example

In the Attributes Example you will see a list of Modules (eSpaces), then a list of the selected module Entities and from there the list of Attributes of the selected entity.

Notice how the system is able to identify foreign keys or attributes of type entity

Foreign Keys Example

In the Foreign Keys Example you will see a list of Entities of this Module and the dynamic display of a record.

Notice how the system is able to show you the actual value (Label or 1st Text Attribute) of the foreign key rather than just the ID.

(If the table does not have any Label or Text attribute it will display the ID instead) 

Reviews (0)
Samples & How-tos
Support Options
This component is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from Rui Barbosa who created this component.
See all 2 dependencies
Component Consumers
Data Model Introspection has no consumers.
Weekly Downloads 
Related Components
Silk UI Responsive Sample App
Functional fully-responsive application built with the Dublin template and Silk UI patterns, visit for more information.
OutSystems UI Mobile Samples
Get inspired and accelerate your development with these beautiful sample screens. Choose from an amazing collection of beautifully designed screens. Learn how to start using Silk UI and see the examples at 
Dynamic Forms
Huarlem Lima
Component to create dynamic forms with validation, tips and dependent fields. Very useful when the user needs to create his form, create polls, surveys, quiz and checklists. You can sort the fields by dragging and dropping.
More from Rui Barbosa
Rui Barbosa
IdP Connector is a generic federated identity provider (IdP) connector, i.e., the IdP Connector its an IdP Service Provider. It allows your OutSystems applications to integrate with single sign-on (SSO) provided by most of the commercial IdP companies. With this integration when the users access an OutSystems application, they are redirected to a web page (known as the enterprise's login manager) where they are prompted to enter their enterprise user name and password. Upon verification of the user’s login, the enterprise identity provider informs OutSystems application of the verified identity for the user who is logging in, and the user is redirected back to the portal website. Also supports SSO from OutSystems mobile apps, alongside with IdP Mobile connector. Tested with Okta, Azure, ADFS, PingOne and OneLogin
Mário Araújo
This is a simple extension that wraps the Hashtable class. It currently supports text. 
REST Integrated Authentication
Pedro Oliveira
Extension enabling the use of REST Web Services that require NTLM / Kerberos authentication. An example is provided for calling a K2 REST web service. Can use integrated authentication from browser New demo including an Integrated Authentication REST service