Query to check where user id is used as foreign key

Could someone provide Outsytems query to check which all entities/tables are using User Id from User entity as foreign key in same Outsytems Database.

HI @Pawan Kumar Sharma ,

If you can go to your core module where all the entities are present then you can right click on user table and ciick "find usage" - It will list down all the refrences which wil include entities as well. 

The result grid will have location column as shown below and it will give you all the entity names which has userid refernce as foreign key.

Hope this helps.




there's a video explaining the process described above:



Hi @José Gonçalves  & @Vani Mankad ,

Using above approach, we can only see the usage of User Entity in same eSpace as it is in System Component. I want to know which all entities uses User Id as foreign Key, not only in one module, but across the database in same server. There are multiple teams in our project who on regular basis creates their own core modules referencing user Id. I would like to know names of all those Entities. I believe it should be possible through Advance SQL, using System's Entity & Entity_Attr table and print it on some UI. I am looking for that solution.

Hi @Pawan Kumar Sharma ,

yes, you can use the system datamodel, 'entity' and 'entity_attr' entities, to find this information.

See attached oml with rough first attempt, UI is to be improved, but you can see the aggregate needed.



@Dorine Boudry : Thanks!! This helps :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.