How do I enter data when extending a table that already has data in it?

KazukiM
Tera Contributor

I want to extend the user table(sys_user) to create a user information table(my_app_user_info) dedicated to my application.

 

I know that when I add a record to the extended table, a record will also be automatically created in the original table
and user table also has a uniqueness constraint based on the user ID.

 

I think this is not able to create record to my_app_user_info for users who are already using this instance.

What should I do?

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@KazukiM 

that's the correct and how extending sys_user works.

It's the same behavior when User table is extended in CSM space.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @KazukiM 

 

Yes mate your understanding is correct here.

 

https://www.servicenow.com/community/in-other-news/how-does-the-magic-from-extend-table-work/ba-p/22...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Mike Lynch
Tera Expert

I am assuming based on the info provided you are just trying to store additional data about users. A user "information" table should not extend the sys_user table - it should reference it. Make a foreign key (reference field) to the sys_user in your table. Extending is not the right approach.