# I want to put in relation two tables

**URL:** <https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984>\
**Category:** Ask for Help\
**Created:** [November 23, 2021, 11:52pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984 "2021-11-23T23:52:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 23, 2021, 11:52pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/1 "2021-11-23T23:52:13Z")

</div>

Hi,  
I need to link two tables in this way:  
I have a table that collect some things called “actions”, every action is a row.  
I have also a table that collect the events, every events must be linked with one or much more actions.  
So, I tryed to create one more table, like a relation table, where I can collect the relation between an event and one or more then one actions. A simple Table with two columns (Events and Actions). When I am into an Event I show a list of Actions where the action on click is add a new row where I put on the Actions column the ID of the Action. But I don’t know how I can put on the Event column the Events ID.  
Please help me.

---

<div class="post-metadata">

**Author:** ![MIKAHEL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikahel/32/25039_2.png) [@MIKAHEL](https://community.glideapps.com/u/MIKAHEL)\
**Post date:** [November 24, 2021, 12:05am UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/2 "2021-11-24T00:05:56Z")

</div>

so you made the following

```auto
tbl actions tbl events tbl act/events
onclick write onclick;write
                                read onclick/read

```

first of all why you didnt make it simpler like this

```auto
tbl actions tbl events         
onclick write ; onclick     
                                read ; onclick

```

then you can relate those via the ONCLICK action

if you agree with this then we may check else

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 6:07am UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/3 "2021-11-24T06:07:14Z")

</div>

Thank’s Mikahel,  
I agree with your strategy and I was trying also that, but probably in a the wrong way.  
Can you explain your strategy?

Thank’s a lot!

---

<div class="post-metadata">

**Author:** ![MIKAHEL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikahel/32/25039_2.png) [@MIKAHEL](https://community.glideapps.com/u/MIKAHEL)\
**Post date:** [November 24, 2021, 7:43am UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/4 "2021-11-24T07:43:20Z")

</div>

Luca,  
nessuna strategia, semplicemente crei una tabella con le azioni ed una tabella con gli eventi e le metti in relazione.

per fare una cosa fatta bene dovresti creare le tabella in questo modo:

Tabella Azioni  
**ROW ID** (chiave primaria)  
Codice Azione  
Descrizione

Tabella Eventi  
ROW ID (chiave primaria)  
Codice EVENTO  
Descrizione  
**ID AZIONE**

Quindi in GLIDE devi creare una chiave multipla tra Azioni ed eventi  
Cioe’ la RELATION COLUMN tra le 2 tabelle ( **AZIONI\ROWID = EVENTI\ID AZIONE** )  
cosi facendo per ogni azione (ad esempio CLICK) corrispondono piu eventi  
Cosi otterrai un ARRAY di eventi possibili da scegliere.

Ovviamente bisogna vedere cosa devi farci.

spero ti possa aiutare.  
ciao

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 1:19pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/5 "2021-11-24T13:19:09Z")

</div>

Grazie,  
sei italiano?!  
Ci provo.

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 1:58pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/6 "2021-11-24T13:58:23Z")

</div>

Mi sa che non ho capito.  
Ti posto l’app. [https://novel-sidewalk-0938.glideapp.io/](https://novel-sidewalk-0938.glideapp.io/)  
Sulla tab Eventi ho inserito all’interno di ogni singolo evento l’elenco di tutte le Azioni (appartenenti alla Tab Azioni).  
Io vorrei che, cliccando su un’azione, si attribuisca una relazione tra l’azione e l’evento in modo tale da poter visualizzare che all’interno di un evento si svolgono tutta una serie di Azioni.

Spero di essere stato chiaro.  
Grazie per la pazienza.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 24, 2021, 2:03pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/7 "2021-11-24T14:03:03Z")

</div>

The easiest way is to have a form button on your event details screen. Then in the form you add a column value component that passes the event ID through to the form to the action table. That way, every action will have the associated event ID included when the action is created. Then all you need to do is create a relation in the events table to link the event ID to the event ID in the actions table.

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 2:22pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/8 "2021-11-24T14:22:41Z")

</div>

Ok, I’m near to the solution.  
How can I pass a value from a list (in this case the Actions) through the form?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 24, 2021, 2:30pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/9 "2021-11-24T14:30:14Z")

</div>

It’s just a component in the form screen that you add like any other components. The only difference is that you won’t actually see anything new on the app screen because it passes that value behind the scenes when the form is submitted. This documentation is showing an old version of glide, but the concept is the same.

> **[Column values](https://docs.glideapps.com/all/reference/values/column-values#column-values-in-submission-screens)**
>
> Access values for the current item

Like I said earlier, the form button should be on your event screen. Then you will be able to pass any value from that specific event to the actions table when the form is submitted.

---

<div class="post-metadata">

**Author:** ![MIKAHEL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikahel/32/25039_2.png) [@MIKAHEL](https://community.glideapps.com/u/MIKAHEL)\
**Post date:** [November 24, 2021, 4:53pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/10 "2021-11-24T16:53:50Z")

</div>

Vedo di riprodurre la casistica in un mio progetto adhoc, domani però.  
Cerca comunque di seguire il tutorial che ha indicato Jeff

---

<div class="post-metadata">

**Author:** ![MIKAHEL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mikahel/32/25039_2.png) [@MIKAHEL](https://community.glideapps.com/u/MIKAHEL)\
**Post date:** [November 24, 2021, 5:00pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/11 "2021-11-24T17:00:53Z")

</div>

Sono italiano ma vivo in Giappone, per cui i nostri tempi non coincidono.  
Cercherò di aiutarti per quel che posso.  
Ciao

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 8:43pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/12 "2021-11-24T20:43:42Z")

</div>

Grazie mille, gentilissimo. Mi metto a studiare.

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 8:51pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/13 "2021-11-24T20:51:02Z")

</div>

Ok, I understood how it works, but I didn’t understand how I can choose some values from a list to send through the form.  
Sorry, I’m a novice of Glide

---

<div class="post-metadata">

**Author:** ![Mozza](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mozza/32/34362_2.png) [@Mozza](https://community.glideapps.com/u/Mozza)\
**Post date:** [November 24, 2021, 8:59pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/14 "2021-11-24T20:59:21Z")

</div>

Hi @Luca_Pellegrini  
Here… while on the Form screen, click + for adding components and you will see some new options:

 ![setColumnValues](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/a/6aa59ac7a663c3199a8ab00066dfc7ad38a63b38.jpeg)

Sorry if I misunderstood your question.

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 9:24pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/15 "2021-11-24T21:24:48Z")

</div>

Thank’s a lot for helps.  
Glide have a great community.  
I solved my problem with a multiple choice. With the choice I can select the Action’s ID and with the column value I can send the Event ID to a Relation Table, then I can display the relation column like a list.  
Thank’s to everybody.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 24, 2021, 10:23pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/16 "2021-11-24T22:23:08Z")

</div>

Just to add, what we have been describing above doesn’t require you to have a separate relation table. You should only need your Events table and Actions table. The relation column is created on the Events table and relates directly to the actions in the Actions table, with a matching event ID, as long as you also have a column to store the Event ID in the Actions table.

But maybe I’ve misunderstood as well, and the list of actions don’t change. In that case, I think you can have your multiple choice component directly update a column in the the Events table with your list of selected actions. Then you can use a Split column to split those multiple choices into an array. The you can create a Relation column that links the split array to your Actions table.

In either case, I don’t think you need a separate relation table, unless I’m still not following.

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 10:40pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/17 "2021-11-24T22:40:30Z")

</div>

In fact my solution doesn’t work 😅  
I want to follow your advise, but I don’t know how can I update the column to store the Event ID in the action table from the Events TAB.  
Really sorry

---

<div class="post-metadata">

**Author:** ![Mozza](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mozza/32/34362_2.png) [@Mozza](https://community.glideapps.com/u/Mozza)\
**Post date:** [November 24, 2021, 10:51pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/18 "2021-11-24T22:51:31Z")

</div>

Hey, @Luca_Pellegrini is there a chance to show us a screenshot of your Form screen when + (from components list) is pressed?  
It might give us a clearer picture of how your data is related (or not).

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 11:00pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/19 "2021-11-24T23:00:08Z")

</div>

![Schermata 2021-11-24 alle 23.57.52](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/d/bd70cebfea2d5622b5d100347b4523de60dcb0dd.jpeg)  
This is Events tab that shows all the events

---

<div class="post-metadata">

**Author:** ![Luca\_Pellegrini](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_pellegrini/32/16485_2.png) [@Luca\_Pellegrini](https://community.glideapps.com/u/Luca_Pellegrini)\
**Post date:** [November 24, 2021, 11:04pm UTC](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984/20 "2021-11-24T23:04:17Z")

</div>

![Schermata 2021-11-24 alle 23.58.08](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/9/49b9a7c6e59feb69d2a3b517af125cafeb903d41.jpeg)

Every Event can contain some Actions and I don’t know how I can put an Activity into an Event from here.

😭

[Next page](https://community.glideapps.com/t/i-want-to-put-in-relation-two-tables/34984.md?page=2)
