# Create a Template " Integrate fields from two different tables "

**URL:** <https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425>\
**Category:** Support\
**Tags:** v4-0\
**Created:** [March 27, 2019, 4:15pm UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425 "2019-03-27T16:15:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wchoumi](https://community.simplicite.io/letter_avatar_proxy/v4/letter/w/71c47a/32.png) [@wchoumi](https://community.simplicite.io/u/wchoumi)\
**Post date:** [March 27, 2019, 4:15pm UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425/1 "2019-03-27T16:15:09Z")

</div>

Hey,

How I can create a Template " Integrate fields from two different tables ".

Example: I have two tables that have a Many to Many relationship, the problem is that I can’t integrate the fields of both tables in the same template.

Thank you.

---

<div class="post-metadata">

**Author:** ![david](https://community.simplicite.io/user_avatar/community.simplicite.io/david/32/5703_2.png) [@david](https://community.simplicite.io/u/david)\
**Post date:** [March 27, 2019, 5:35pm UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425/2 "2019-03-27T17:35:17Z")

</div>

Please copy/paste your model so as we understand what you need…

For instance in the demo the “Order” objet’s form displays fields from 4 business objects: Order (of course), Customer, Product and Provider:

 ![image](https://community.simplicite.io/uploads/default/original/2X/4/42487d27ff465955ab8a49d4db2185c844091638.png)  
This is possible because of the following business model:  
 ![image](https://community.simplicite.io/uploads/default/original/2X/9/995e8f9e91f592067f9e312f0872acf8157398c1.png)  
With such model it is not possible to display fields from Contact on the order form (but it is possible to display a **list** of Contacts), but it is possible to display fields from Order, Customer, Product and Supplier on the Contact form.

In summary there is no general answer to your question, it depends on your model and on the object you are considering.

---

<div class="post-metadata">

**Author:** ![wchoumi](https://community.simplicite.io/letter_avatar_proxy/v4/letter/w/71c47a/32.png) [@wchoumi](https://community.simplicite.io/u/wchoumi)\
**Post date:** [March 28, 2019, 8:48am UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425/3 "2019-03-28T08:48:48Z")

</div>

I would like to display in the same Template All fiels of “Contenu” & “Ressource”, considering that relation between “Contenu” & “Ressource” is Many to Many.

PS: AppRessourceContenu it is the table that has been generated by the relation between the two tables “Contenu” & “Ressource”.

 ![Mod%C3%A8le](https://community.simplicite.io/uploads/default/original/2X/5/555b7f17a7a76728a0123cfd37bbd9b31e4fa0b9.png)

---

<div class="post-metadata">

**Author:** ![david](https://community.simplicite.io/user_avatar/community.simplicite.io/david/32/5703_2.png) [@david](https://community.simplicite.io/u/david)\
**Post date:** [March 28, 2019, 9:10am UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425/4 "2019-03-28T09:10:04Z")

</div>

You can display data from a single record of “Contenu” and of a single record of “Resource” only at the level of the N-N object “AppRessouceConteu”

From one object’s form, you can only display fields from another object linked by a 1-N relationship.

However there is a way (“pillbox”) to render the N-N relationship that allows a “compact view” variant of the list of records linked of the other side of the N-N:

 ![image](https://community.simplicite.io/uploads/default/original/2X/5/540497c59d4a2d9677a8c945c453470f4998e877.png)

If you think yous should be able to display “Contenu” fields in “Ressource” (or the opposite) it means the relationship is not a N-N

---

<div class="post-metadata">

**Author:** ![david](https://community.simplicite.io/user_avatar/community.simplicite.io/david/32/5703_2.png) [@david](https://community.simplicite.io/u/david)\
**Post date:** [March 28, 2019, 9:17am UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425/5 "2019-03-28T09:17:01Z")

</div>

Other approach: inline the N-N list in the form and add an “Associate” behavior on the link, this is what is done on the other end of the previous N-N example:

 ![image](https://community.simplicite.io/uploads/default/original/2X/0/05699f2370cacafc7a13967d35b0715947fcf538.png)

---

<div class="post-metadata">

**Author:** ![wchoumi](https://community.simplicite.io/letter_avatar_proxy/v4/letter/w/71c47a/32.png) [@wchoumi](https://community.simplicite.io/u/wchoumi)\
**Post date:** [March 28, 2019, 9:45am UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425/6 "2019-03-28T09:45:06Z")

</div>

Thank, I’ll try and come back to you

---

<div class="post-metadata">

**Author:** ![system](https://community.simplicite.io/user_avatar/community.simplicite.io/system/32/4700_2.png) [@system](https://community.simplicite.io/u/system)\
**Post date:** [March 30, 2021, 6:44pm UTC](https://community.simplicite.io/t/create-a-template-integrate-fields-from-two-different-tables/1425/7 "2021-03-30T18:44:59Z")

</div>

Closed on March 30, 2021, 6:44pm UTC


