How build relationship between user and project

Ramu8
Tera Expert

I need to build relationships between user and project (u_project) should same like as skill(cmn_skill) and user (sys_user) in servicenow where record are stored in user skills (sys_user_has_skill) as oob  please advice 

 

1 ACCEPTED SOLUTION

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Ramu8 ,

 

To establish a relationship between the User and Project tables in ServiceNow similar to the skill relationship, you can create a reference field in the Project table that refers to the User table. Additionally, you can create a related list on the User table to display associated projects.

 

1. **Create Reference Field in Project Table:**

   - Go to the Project table in ServiceNow.

   - Create a new field, let's call it `user_ref`, of type Reference.

   - Set the reference table to the User table.

 

2. **Create a Related List in User Table:**

   - Go to the User table in ServiceNow.

   - Create a new related list, let's call it `projects`.

   - Configure the related list to display records from the Project table where the `user_ref` field matches the user.

 

3. **Establishing Many-to-Many Relationship:**

   - If you need a many-to-many relationship, you may consider creating a separate table (e.g., `user_project_mapping`) with reference fields to both User and Project tables.

 

4. **Populate User Skills Table:**

   - If you want to store additional information about the relationship (similar to `sys_user_has_skill`), you can create a new table (e.g., `user_project_mapping`) to store these records.

 

Keep in mind that "out of the box" (OOB) configurations might vary, so adjust these steps based on your specific ServiceNow instance and version. Additionally, consider testing the changes in a non-production environment before implementing them in your live instance.

 

Thanks,

Danish

 

View solution in original post

6 REPLIES 6

Hi @Ramu8 ,

 

As ur question mentioned u want something similar to user skills table hence the 4th point. If u want to go with many to many relationship & store additional information related to it then u can create a new table named as user project table n store the relevant info.

 

Thanks,

Danish

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Ramu8 

 

https://servicenowguru.com/system-definition/relationships/creating-manytomany-relationship-servicen...

 

*************************************************************************************************************
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]

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