# How to make a relation column inherit the form context?

**URL:** <https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008>\
**Category:** Ask for Help\
**Created:** [February 12, 2025, 1:44pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008 "2025-02-12T13:44:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfsilvalima](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mfsilvalima/32/85132_2.png) [@mfsilvalima](https://community.glideapps.com/u/mfsilvalima)\
**Post date:** [February 12, 2025, 1:44pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/1 "2025-02-12T13:44:48Z")

</div>

Hello, I’m creating a simple training application.

So I have the Teacher, Student, Student Training and the Training Exercise.  
I made all the relationships in the tables and everything has been working well.  
However, I’m having trouble registering.

Scenario: Teacher created a student and now he needs to create the student’s training, but at the time of creating the training, even though he is already in the student context, he needs to fill in the “relation\_student” column.

So my question is, how do I make the relation column inherit the form context?

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [February 12, 2025, 2:57pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/2 "2025-02-12T14:57:35Z")

</div>

The relation column needs another column to find the right data in other tables / queries.

What have you done so far?

---

<div class="post-metadata">

**Author:** ![mfsilvalima](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mfsilvalima/32/85132_2.png) [@mfsilvalima](https://community.glideapps.com/u/mfsilvalima)\
**Post date:** [February 12, 2025, 4:35pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/3 "2025-02-12T16:35:38Z")

</div>

@MaximeBaker  
In the “training table” I have the exercise relation column: “relation\_exercicis”

 ![Screenshot 2025-02-12 at 13.25.57](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/6/16a7baa80d0e3c4e1ca568c2f59f9d54ccf757d3.png)  
In the exercise table I have the training relation: “relation\_treino\_id”  
 ![Screenshot 2025-02-12 at 13.25.52](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/a/5aba9282586a8064ac6267d818b1ad70ee7aaa5b.png)

I’m showing a different scenario than my first post, but it’s the same idea.

The only solution I found was to force the user to select the workout, even if he is already in that context.  
But since I’m already in the training context. Ex: Day 2

 ![Screenshot 2025-02-12 at 13.30.34](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/1/a12231dec56a341f602aa59d7250ac6a229e42c5.png)  
I didn’t want to ask the user to select the workout again. Input “treino”. Ex: Day 2  
 ![Screenshot 2025-02-12 at 13.30.46](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/4/a49c78a3d8a920fa8a16e648f57ab4776144ceaf.png)

In other words, I wanted the “relation\_treino\_id” column to be filled in automatically, without asking the user, as he is already in that context.

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [February 13, 2025, 12:49am UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/4 "2025-02-13T00:49:33Z")

</div>

What action does the ‘Cadastrar’ button perform?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [February 13, 2025, 2:05am UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/5 "2025-02-13T02:05:47Z")

</div>

How are you creating that relation? I assume from an ID?

You can add a special value to the form, filling the Treino ID to the column in the destination table.

---

<div class="post-metadata">

**Author:** ![mfsilvalima](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mfsilvalima/32/85132_2.png) [@mfsilvalima](https://community.glideapps.com/u/mfsilvalima)\
**Post date:** [February 13, 2025, 11:25am UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/6 "2025-02-13T11:25:14Z")

</div>

@MaximeBaker

“Cadastrar” has an action to open the form to register the exercise.  
Cadastrar is register in Portuguese.

 ![Screenshot 2025-02-13 at 08.16.33](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/4/c4fc3e4a2b712b45f81ae7edf12486da3fb4500f.png)

@ThinhDinh  
Yes, I am doing the relation by ID

But how do I do this?  
I tried using this option in the print below, but it doesn’t even show the Relation column I need.

 ![Screenshot 2025-02-13 at 08.21.47](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/a/aa0bb3b1e32fa9f71088cf9a72d7fdd0cec8ff57.png)  
The second input, which is “treino\_id” is the training ID, but there is no way (or I don’t know how) to choose it to be the ID of the context that the user is in.

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [February 13, 2025, 11:53am UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/7 "2025-02-13T11:53:58Z")

</div>

What is the context of the form screen? Training?

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [February 13, 2025, 12:00pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/8 "2025-02-13T12:00:19Z")

</div>

Here, you can use screen value of the id or name of the selected training and set the column to the training id in the target table.

 ![1000014253](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/1/b1ca3e7446fa0f359d6f02d0d7f7b807f101f7fb.jpeg)  
 ![1000014254](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/e/be3c85aa3a1db4420fa79a12077bc1fc962a0728.jpeg)

---

<div class="post-metadata">

**Author:** ![mfsilvalima](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mfsilvalima/32/85132_2.png) [@mfsilvalima](https://community.glideapps.com/u/mfsilvalima)\
**Post date:** [February 13, 2025, 12:13pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/9 "2025-02-13T12:13:56Z")

</div>

@MaximeBaker

YOU ARE AMAZING BRO  
It worked perfectly. I solved another problem with row owner, using the same concept it worked too

Thanks \<3

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [February 13, 2025, 1:11pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/10 "2025-02-13T13:11:17Z")

</div>

Anytime brother!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [February 20, 2025, 1:11pm UTC](https://community.glideapps.com/t/how-to-make-a-relation-column-inherit-the-form-context/80008/11 "2025-02-20T13:11:36Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
