Outsystems user identifier different across environments

Is it possible to create an Outsystems user in a development environment with a specific id that is the same id for that user in production environment?

I would say not out of the box - the User provider module is a System one so it is not wise to clone/adapt/mess with it too much. However, you can create a wrapper entity in your espace (like User_Profile or something like that) with a 1:1 relationship with your the User table and then set the ID on that using whatever methodology you want to generate the ID. If you want the ID to be auto-generated or auto-number, though, it seems to me this is not something that can or should be done. 

May I ask what the use-case is? This might not be necessary.

Hi Scott,

To add what Grayson already correctly stated:

For any entity in OutSystems with an automatically calculaed Identifier, being a Systems entity like User or any other entity you use, you should not assume to be able to have the same Id for the same record across environments.

The entiy identifier is by default a type Long Integer and its value is automatically calculated in sequence (an AutoNumber in OutSystems). This way, you don't have to implement any specific logic to uniquely identify each entity record. This also means you cannot enforce to issue the same Id's for the 'same' records in other environments.

For your own defined entities you can use other data types as Entity Identifiers or switch off the AutoNumber in an attribute. In this cases, you have to implement the logic to uniquely identify each entity record. I this situation you can ensure to have the same Id for records in different environments. This is often done with Static entities.



Thanks, Grayson and Daniel, for such quick responses.  Very grateful.

To expand on what I'm trying to accomplish, I need to map OS users to my own users table.  Given what you've both provided it seems like my first approach is not going to work.  What I was thinking of is using the External_Id field as a way of providing a mapping between my users table and OS user table across my development, testing and production environments.  It's the multiple environments which is the crux move for me.

My question is, am I properly using the External_Id field or is it reserved for another purpose such as third party authentication providers?



You know, I don't have a lot of experience in this realm but it appears that external_id field is generally for this purpose (although I cannot really find any documentation). For this purpose you could also go as far as to use Integration Studio to connect the OutSystems User table to the external user database you are trying to reference. If possible, I you could integrate SSO into your user system - I believe this would be the most ideal way to move forward if your user database can be used as a standard identity provider. 

You are right Grayson, external_id should be used in this situation.

Again, thanks for the assist.

First, I was able to accomplish what I needed to using external_id as you and Daniel both mentioned was not breaking any rules (at least that we could find).

Second, I am intrigued by your suggestion of ...

"For this purpose you could also go as far as to use Integration Studio to connect the OutSystems User table to the external user database you are trying to reference."

 I took a look at Integration Studio and I didn't see a way of integrating my external users table with the internal OS User table.  I did find the article below which hints at the fact that you can do this but I couldn't quite figure out how (my struggles, not the author's).  


The dialog in this thread was very good.  See Killian's comments.