# How do I  accomplish many to many?

**URL:** <https://forum.kintone.dev/t/how-do-i-accomplish-many-to-many/40>\
**Category:** General\
**Created:** [December 15, 2017, 2:29pm UTC](https://forum.kintone.dev/t/how-do-i-accomplish-many-to-many/40 "2017-12-15T14:29:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [December 15, 2017, 2:29pm UTC](https://forum.kintone.dev/t/how-do-i-accomplish-many-to-many/40/1 "2017-12-15T14:29:52Z")

</div>

Hi there.

I have three&nbsp;types of data and therefore three apps: Presenters, Programs and Program Instances (occurring on specific dates).

Presenters can lead many Programs, Programs can have one&nbsp;or more Presenters, Programs can repeat and be lead by different Presenters on different dates.

What I’m trying to figure out is how to create Many to Many connections in Kintone. I would like to create a new Program Instance and then connect one Program to it (LookUpFieldA) and 1 to 10 Presenters to it&nbsp;(LookUpFieldB)&nbsp; but the lookup field only allows one connection.

Also, this&nbsp;is puzzling me:&nbsp;

[https://get.kintone.help/hc/en-us/articles/115001462647](https://get.kintone.help/hc/en-us/articles/115001462647)

“Please note: if data in a record in the datasource app is updated, the record in the destination app will not automatically update. You must navigate back to the destination app, edit the record, click Lookup again, and click Save.”

Doesn’t this defeat the purpose of a relational database?&nbsp;

Thanks for your help!

&nbsp;

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [December 16, 2017, 8:00pm UTC](https://forum.kintone.dev/t/how-do-i-accomplish-many-to-many/40/2 "2017-12-16T20:00:14Z")

</div>

Hi Matthew,

&nbsp;

You can build One-to-One(1:1) and One-to-Many(1:M) relational models with kintone but I am afraid that Many-to-Many(M:M) cannot be created with the current kintone features.

As you know, “lookup field” is for 1:1 model. For 1:M, you can use “Related Records field” and/or create “table”.

&nbsp;

“Related Records field” shows the record(s) that match the condition you specify from the same or another App.

You can place “Lookup field” in the table, so you can select the data from another App.

The following links explain about “Related Records field” and “Table”.

What is “Related Records”?: [https://get.kintone.help/k/en/user/app\_settings/form/related\_records/whats\_relatedrecords.html](https://get.kintone.help/k/en/user/app_settings/form/related_records/whats_relatedrecords.html)

Configuring a Related Records Field: [https://get.kintone.help/k/en/user/app\_settings/form/related\_records/set\_relatedrecords.html](https://get.kintone.help/k/en/user/app_settings/form/related_records/set_relatedrecords.html)

How to Create a Table: [https://get.kintone.help/k/en/user/app\_settings/form/table.html](https://get.kintone.help/k/en/user/app_settings/form/table.html)

&nbsp;

Regarding the lookup field at the destination App that does not update automatically, you are right that you need to update the record for the field at Destination App that has been updated at source App.

If you want kintone to do automatically, you can customize your App with API(PUT). Or with the current basic feature, you can mass update using a CSV file.

Please see the link about API.

[https://developer.kintone.io/hc/en-us/community/posts/220307528-Look-up-source-fields-not-updating](https://forum.kintone.dev/hc/en-us/community/posts/220307528-Look-up-source-fields-not-updating)

This is written in Japanese:[https://developer.cybozu.io/hc/ja/articles/204537310-%E7%AC%AC11%E5%9B%9E-kintone-REST-API%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%9F%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E6%9B%B4%E6%96%B0](https://developer.cybozu.io/hc/ja/articles/204537310-%E7%AC%AC11%E5%9B%9E-kintone-REST-API%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%9F%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E6%9B%B4%E6%96%B0)

&nbsp;

Here is how to mass update Lookup field data using CSV file.

1. Set “Prohibit duplicate values check box” for the Key field in the data source app.

2. Export records from file at Destination App

Please refer the following link.

[https://get.kintone.help/k/en/user/app\_collectdata/data\_export.html](https://get.kintone.help/k/en/user/app_collectdata/data_export.html)

\*At Step 4, select “Include header row”.

\*At Step 7, only select “Record Number field” and “Lookup field”.

1. Update the data on the CSV file just created

2. Import records from file at Destination App for mass update

Please refer the following link.

[https://get.kintone.help/k/en/user/using\_app/import\_records/recordupdate\_bulk.html](https://get.kintone.help/k/en/user/using_app/import_records/recordupdate_bulk.html)

Hope this helps.

&nbsp;

Thank you.

&nbsp;

Junko

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [December 18, 2017, 6:15am UTC](https://forum.kintone.dev/t/how-do-i-accomplish-many-to-many/40/3 "2017-12-18T06:15:04Z")

</div>

kintone isn’t a relational database.  
It has two features that fetch data from another table (App), but it is not a relational database.

**Feature 1: Look-up field**  
Treat this field, as a field that just helps you to fill in multiple fields in one go.  
By entering 1 set of data, the lookup field will fill in the rest of the fields (the field mappings).  
This only copies data, and does not copy any information about relationships.

**Feature 2: Related Records field**  
This feature looks at a given field value and condition, and then displays all record data that match the condition. Note that this only displays data, and does not save any sort of data into the record. Every time you load the browser, it will give back a new list that matches the given condition.

Now, for your scenario, I would create 3 kintone Apps.  
-Presenters  
-Programs  
-Program Instances

**"Presenters"** would contain info of the presenters - name, hire date, gender etc.  
 ![](https://developer.kintone.io/hc/user_images/x0iAgmrodx04jr5uK6PFFA.png)

**"Programs"** would contain info of the program details - name, details etc.  
 ![](https://developer.kintone.io/hc/user_images/VH1rpc_g1QyYFKofQLkvNQ.png)

**"Program instances"** is where you would place lookup fields inside, to get data from the Presenters App and Programs App.  
As there would be multiple presenters, you would want to place the lookup for presenters in a table.  
 ![](https://developer.kintone.io/hc/user_images/QEtMCjfAvMJyR-8KBnnisg.png)

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [December 18, 2017, 6:27am UTC](https://forum.kintone.dev/t/how-do-i-accomplish-many-to-many/40/4 "2017-12-18T06:27:09Z")

</div>

I made a gif of what the data entry looks like for the Program instances.

![](https://developer.kintone.io/hc/user_images/3M0ZBNdgu0gkEEuSApigRw.gif)

I’m not sure much about your scenario, but I don’t really see a need for these being a relational database.  
Is there a case where you would need to change a field in the Presenters or Programs DB ,to have it reflected on to the Program instances?

&nbsp;

And one more thing.  
You could also go back to your Programs DB to set up a Related Records field.  
This will pick up the Program instances related to that Program.

![](https://developer.kintone.io/hc/user_images/RXUSm93D6ibl1JObJcXaTA.png)

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [May 10, 2018, 8:46pm UTC](https://forum.kintone.dev/t/how-do-i-accomplish-many-to-many/40/5 "2018-05-10T20:46:29Z")

</div>

Akira, using an “instances” app is a brilliant approach! It solved my problem.
