# Help with Simple connection

**URL:** <https://forums.knack.com/t/help-with-simple-connection/12289>\
**Category:** Knacksters' Idea Lab\
**Created:** [March 26, 2022, 2:58am UTC](https://forums.knack.com/t/help-with-simple-connection/12289 "2022-03-26T02:58:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bobby](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Bobby](https://forums.knack.com/u/Bobby)\
**Post date:** [March 26, 2022, 2:58am UTC](https://forums.knack.com/t/help-with-simple-connection/12289/1 "2022-03-26T02:58:03Z")

</div>

I hope this question isn’t too embarrassingly basic. I am trying to do a simple query/view. I have a students object and a workouts object. What I’d like to be able to do is simply add/assign a workout record for every student that performed that workout. I am using the Name field as the connector, but don’t know if that’s the best/right way to do it. Any suggestions or help is greatly appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![CarlHolmes](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/carlholmes/32/2814_2.png) [@CarlHolmes](https://forums.knack.com/u/CarlHolmes)\
**Post date:** [March 26, 2022, 5:01pm UTC](https://forums.knack.com/t/help-with-simple-connection/12289/2 "2022-03-26T17:01:05Z")

</div>

Hi @Bobby

I presume your students would do different workouts, not just one workout?  
If so, you need to connect the Workouts object to your Students object as a one to many connection. (many workouts for each student). On your Students object you can change the display field so it shows the name of the student in the Workouts object.

**Display Fields**

> **[Use Connections in Your App](https://learn.knack.com/article/uoixa7mhy4-use-connections-in-your-app#display-fields)**
>
> Connections in the Builder. This information is referenced in the About Connections article. If you're just getting started, be sure to start with that article first. This article provides detailed i…

Then create a page view with a table showing your Student object, add “edit” and “view” links as required. and a child table of related Workouts beneath each Student.

You can then add a form that adds a new workout to the student linked from a menu.

Happy to connect and walk you through this.  
I can provide one-to-one training and consultation on a chargeable hourly basis.

> **[CH Project Support Limited](https://www.youtube.com/channel/UC17_VQfdwzFYWb9Uw1SAYkg)**
>
> I've been building databases since 1996 primarily using Microsoft Access and plenty of VBA. In 2017 I was introduced to Knack and have never looked back. My motivation to build is to provide a solution that is intuitive, consistent and makes the...

---

<div class="post-metadata">

**Author:** ![Bobby](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Bobby](https://forums.knack.com/u/Bobby)\
**Post date:** [March 27, 2022, 4:37pm UTC](https://forums.knack.com/t/help-with-simple-connection/12289/3 "2022-03-27T16:37:08Z")

</div>

You’re awesome Carl. I’ll give that a try and also check out the videos. Yes, it is a one-to-many relationship. Both ways, right? Where each student can do more than one workout…and each workout can be done by many students.

---

<div class="post-metadata">

**Author:** ![CarlHolmes](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/carlholmes/32/2814_2.png) [@CarlHolmes](https://forums.knack.com/u/CarlHolmes)\
**Post date:** [March 27, 2022, 6:47pm UTC](https://forums.knack.com/t/help-with-simple-connection/12289/4 "2022-03-27T18:47:09Z")

</div>

One to many relationship between Workouts and Students.

Each Student can have many Workouts.  
Each Workout connects to one Student.

As long as you add a connection from your Workouts object to Students object you can just except the connection defaults. 👍

---

<div class="post-metadata">

**Author:** ![Bobby](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@Bobby](https://forums.knack.com/u/Bobby)\
**Post date:** [March 31, 2022, 12:44am UTC](https://forums.knack.com/t/help-with-simple-connection/12289/5 "2022-03-31T00:44:03Z")

</div>

What is I want to build a workout template? Like this  
Workout Example  
DB Press: Field1\_WeightUsed & Field2\_Reps  
DB Squat: Field3\_WeightUsed & Field4\_Reps

I want to be able to create a new workout record, then select the student and the workout he/she did. Then fill in those fields. How would l do that.

I know in Lotus Notes it was a subform LOL

---

<div class="post-metadata">

**Author:** ![CarlHolmes](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/carlholmes/32/2814_2.png) [@CarlHolmes](https://forums.knack.com/u/CarlHolmes)\
**Post date:** [March 31, 2022, 6:22am UTC](https://forums.knack.com/t/help-with-simple-connection/12289/6 "2022-03-31T06:22:47Z")

</div>

A sub form may be different in Lotus Notes. 😊

In MS Access a subform displays records that are related to the current record in the main form. It’s simply a way of showing child records related to a parent embedded in the same view.

Knack doesn’t use subforms, however, in my experience you can still create views that show the related data in a logical fashion.

You mention using a “template” for different workouts. This would require either using record rules to create the connected line items, which may become complex depending on quantity of templates. Or or use Make/Integromat to create them via the API.

> **[Using Record Rules](https://learn.knack.com/article/hzq45ocu8u-forms-using-record-rules#insert_a_connected_record)**
>
> What are Record Rules? Record rules are a type of rule, which allow you to automate specific actions behind-the-scenes when a form is submitted or a table is edited inline in the Live App. These rule…

It sounds like you are tying to “lookup” a list of workout line items (template) and connect them to the session and user.

Creating related records automatically connected to a user is possible, however, depending on how many line items you are creating for each workout, it will increase the amount of time it takes to create.

Typically, it takes about a second for each line item to be created. This may not be an issue if the users session covered 6-10 different disciplines.

Currently, if you have your app setup you will need to add each type of workout line by line.

I have many apps that have a “template” that Make/Integromat looks up and then creates the line items connected to the user. This works well if you have lots of different “template” options.

You’ll appreciate this may be complex and beyond the scope of a forum reply.
