# How to join to "all"

**URL:** https://the.fmsoup.org/t/how-to-join-to-all/3231
**Category:** Floating Topics
**Tags:** join
**Created:** [November 29, 2022, 10:20pm UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231 "2022-11-29T22:20:14Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)
#### Post date: [November 29, 2022, 10:20pm UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/1 "2022-11-29T22:20:14Z")

</div>

So I have a table of contacts, and a table of events. I want to have a join where when on the contact layout I see ALL events, and can add new ones.

What's the easiest way to do this?

I tried joining the two primary keys using ≠ and "allow creation of new" events was greyed out. So I made two fields called "Number1ForJoins" in both tables, which were calculations with the number 1 in them.  
I tried two fields that are blank "number" fields and joined them.

But when I try to add a new event it says "This field is not editable"... which is odd because it's "editable" but I can't "add" new events.

Is there a standard way to say "show everything from this otherwise unrelated table in a portal"?

---

<div class="post-metadata">

### Author: ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)
#### Post date: [November 29, 2022, 11:50pm UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/2 "2022-11-29T23:50:55Z")

</div>

Cartesian join, the "x" in the "Edit Relationship" join options, between the tables.

---

<div class="post-metadata">

### Author: ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)
#### Post date: [November 30, 2022, 1:50am UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/3 "2022-11-30T01:50:50Z")

</div>

I've tried both ≠ and X and both of them grey out the "allow creation of records" option:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/b/babcdf5a1b6afcc257e0541b075c684546f73fee.png)

---

<div class="post-metadata">

### Author: ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)
#### Post date: [November 30, 2022, 3:09am UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/4 "2022-11-30T03:09:20Z")

</div>

A cartesian join returns all records. It is not based on a relationship, therefore you can't make a related record via the relationship. You will need to script the new record creation.

---

<div class="post-metadata">

### Author: ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)
#### Post date: [November 30, 2022, 9:42pm UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/5 "2022-11-30T21:42:54Z")

</div>

Ok yeah that's not what I'm looking for then. I created a separate scripts for now but I might try some other joins to get it to work showing all and also allowing creation of new records within the portal, which is the ideal situation.

---

<div class="post-metadata">

### Author: ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)
#### Post date: [November 30, 2022, 10:33pm UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/6 "2022-11-30T22:33:22Z")

</div>

I think there is a fundamental misunderstanding here.

A relationship works by matching one or multiple fields of left side records of the relationship with an equal amount of fields of the right side records of the relationship, each according to an operand (=, ≠, \<, ≤, \>, ≥, x).

FileMaker can create records via a relationship when all operands are =, ≤ or ≥ because it copies the value of the match field(s) of the record that already exists into the match fields of the record being created.

That can't happen when any operand is ≠, \<, \> or x in the relationship definition. These operands allow for a range of matching values, none of which is a left side value. For example, let's say any right side record matches a left side record if the right side quantity is greater (\>) than the left side quantity. A left side quantity of 1 would match a right side quantity of 2, 3, 4 and any other value greater than 1. What quantity value should be set when creating a right-side record via the relationship? There is an infinite number of possible values (short of technical limitations).

In short, you will be unable to show all records via a relationship and be able to create a record via the same relationship.

---

<div class="post-metadata">

### Author: ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)
#### Post date: [December 1, 2022, 1:20am UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/7 "2022-12-01T01:20:21Z")

</div>

This is technically possible if you have an auto-enter calc on either side of the relationship that will always match. E.g. auto-enter a value of "1".

I wouldn't necessarily recommend this, and would probably favor an x join for displaying all related and a separate field with a script to create new related records. My hunch is that it might have better performance (but that's just a hunch!)

Here's an example fmp12 file:

[show-all-and-create.fmp12](https://the.fmsoup.org/uploads/short-url/78het4mvOiWPM2YVYhIL2KxPIfy.fmp12) (1.2 MB)

EDIT: I should mention explicitly: _ **DO NOT ENABLE 'delete related' IN THE RELATIONSHIP** _. It will delete all the records in the other table if you delete any single record in the current table.

---

<div class="post-metadata">

### Author: ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)
#### Post date: [December 1, 2022, 2:17am UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/8 "2022-12-01T02:17:17Z")

</div>

ok cool.

I tried joining a blank field to a blank field with no luck.

I was going to try a calc of the number 1 in parent joined to a regular number field in the child.

But in this case I already coded it separately and this feature is only for one tech savvy user so I’ll prob just leave it as a card.

It’s a little more cumbersome for the end user and it works differently than other portals in the app, and I usually go by making it easier for end users when possible since I don’t think the speed difference will be huge but since it already works I’ll probably leave it. Next time I’ll join 1 to 1.

---

<div class="post-metadata">

### Author: ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)
#### Post date: [December 1, 2022, 2:34am UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/9 "2022-12-01T02:34:31Z")

</div>

Nice.

PS, your idea here _would_ also work if it's a one-way creation street. 👍🏼

> I was going to try a calc of the number 1 in parent joined to a regular number field in the child.

I'd still add an auto-enter to the child in case you ever create child records another way, but, if it's always done via portal, even the auto-enter would technically be optional with your approach.

---

<div class="post-metadata">

### Author: ![JasonMark](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JasonMark](https://the.fmsoup.org/u/JasonMark)
#### Post date: [December 1, 2022, 4:05am UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/10 "2022-12-01T04:05:11Z")

</div>

Makes sense

---

<div class="post-metadata">

### Author: ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)
#### Post date: [December 1, 2022, 12:42pm UTC](https://the.fmsoup.org/t/how-to-join-to-all/3231/11 "2022-12-01T12:42:43Z")

</div>

> [@bdbd](#):
>
> In short, you will be unable to show all records via a relationship and be able to create a record via the same relationship.

> [@jwilling](#):
>
> This is technically possible if you have an auto-enter calc on either side of the relationship that will always match. E.g. auto-enter a value of "1".

I stand corrected… and with one of the oldest trick in the book at that. Thanks @jwilling!
