Many to many definition on same table

Christine30
Tera Guru

I know this question has been asked before but I couldn't find a solution. Is it possible to create a many to many definition on the same table?  When I try, I get the error "M2M from field and M2M to field must be different".  Changing the field names doesn't create a correct many to many table.  Thanks for any help with this.


Christine

1 ACCEPTED SOLUTION

Thank you.

 

I was eventually able to do this by creating a list field and related list relationship by following the steps here: https://www.servicenow.com/community/itsm-forum/many-to-many-on-same-table/m-p/440044

 

And then creating a database view using the list field by following the steps here: https://www.servicenow.com/community/developer-forum/database-view-with-list-field/m-p/2432202

View solution in original post

5 REPLIES 5

AshishKM
Kilo Patron
Kilo Patron

Hi @Christine30

Unfortunately, it's not possible using the same table.

Using the same table we can only configure parent/child type relationship.

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Thanks. Can you suggest any sort of work around?  On a custom table, we have current year records that point to many prior year records, and vice versa. 

 

Thank you.

As per my understanding, if current year records are pointing to previous year records then there must be column which have this reference data ( same like parent column in many table , task or Group ).

 

For reporting purpose, you can create a database view on this custom table, use the same table twice with different prefix and use the matching condition to get desire data, not sure about your data model but you can try with DB view.

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Thank you.

 

I was eventually able to do this by creating a list field and related list relationship by following the steps here: https://www.servicenow.com/community/itsm-forum/many-to-many-on-same-table/m-p/440044

 

And then creating a database view using the list field by following the steps here: https://www.servicenow.com/community/developer-forum/database-view-with-list-field/m-p/2432202