Table relationship for two tables

VikramM1
Tera Contributor

Hi,

I have created custom application in studio as per client requirement, i created table A(budget) with form. There is one more table and form linked with same form which is related items.

 

Both are having different fields, how to create relationship between both.

 

The user should be able to enter details of table B related items in table A form.

 

I want this to show relationship table below with new button, as there is no same fields in both how to create relationship. Is there any way

2 ACCEPTED SOLUTIONS

Hi @VikramM1 ,

 

you need to create reference field . without that it is not possible . you can create field but dont show on form that could be a workaround .

 

Thanks,

Astik

View solution in original post

Community Alums
Not applicable

Hi @VikramM1 ,

You need any Reference field which is pointing to Table B, without that it is not possible to make any relationship with any table.

For example You have related list on Incident table with taking reference from User table, you have the caller field as the reference.

 

Please mark my answer correct and helpful if this helps you
 
Thanks and Regards 
Sarthak

View solution in original post

8 REPLIES 8

Astik Thombare
Tera Sage

Hi @VikramM1 ,

 

You can create a relationship between two tables by creating a reference field on your custom table and point it to another table this is a basic relationship which allow the relation between two tables.

 

Please Follow Example -

 

I have created two Tables - Table A and Table B

 

Table A-

AstikThombare_0-1713071685142.png

 

Table B -

 

AstikThombare_1-1713071742790.png

 

Then I have create one field on Table A (Reference to B ) that is referencing to table B

 

 

AstikThombare_2-1713071832076.png

 

Once this is done we need to create relationship between these two tables 

 

Navigate to System Definition -> Relationship 

 

AstikThombare_3-1713071947701.png

 

In Relationship we need create relationship between these two tables 

 

AstikThombare_4-1713072024890.png

 

to know more how to create relationship follow link -https://www.servicenowelite.com/blog/2014/2/6/show-attachments-related-lists

 

Once this is done we need to add related list to table A 

 

Right click on Table A form -> Configure -> Related List 

 

AstikThombare_5-1713072141266.png

Add Related list to table A that we have created 

 

AstikThombare_6-1713072230827.png

AstikThombare_7-1713072267082.png

 

Once that is done you are able to see related list at the bottom of Table A and you will able to create new record for table B using that related list 

 

 

AstikThombare_8-1713072372256.png

 

 

 

 

 

Thanks,

Astik

Hi Astik,  thanks for your reply. but, i dont have any reference field with table A.

Hi @VikramM1 ,

 

you need to create reference field . without that it is not possible . you can create field but dont show on form that could be a workaround .

 

Thanks,

Astik

Okay got it