Very, very simple relation

Not building an app but threw together a quick table to see if I could still remember how to build a relation. Just want to add all the books written by an author in the relation column. Can’t do it for some reason. Also, in the last pic below not sure why the relation gives me the entries in the description column even though that column is not referenced at all in the relation. Confused…

image

Your second screenshot looks to be working properly. The “values” that are given in the Relation column are just references to the rows that the relation is finding.

But how do I get the values in the relation column to be the books the author has written?

If you need to display the list of books in your app, just add an Inline List to your screen and pull in the values of the relation.

That’s what I will do, but there are no values in the relation. The column is empty, as per the screenshot. What have I missed in the set up?

That relation isn’t the same as the 2nd screenshot you posted above. When doing a relation, both sides of it have to match exactly — so you should be relating the Author to the Author in order to find the books they’ve written. You had it right in the 2nd screenshot of your OP.

1 Like

Ok but relating Author to Author gives me the description - how do I get the books in there instead?

Like I said, in the Data Editor, that relation column is just showing you the rows that match — the text of what is written there is basically meaningless. I believe it simply shows the first column from the matching rows so you can see that the relation is working and has found some matches.

Ok got it. I can go to the app editor screen and select the data I want to show from there, via the inline list. I’ve made a few relations in the past and have always had the desired result show in the data editor. It kind of serves as a way of showing that it has worked correctly. Was thrown off seeing other values there. Thanks heaps

1 Like

Think of it like a family.

Say you have yourself (first name, last name, address, etc.), and you want to find all of your relatives with the same last name, so to do that you compare your last name to all of their last names. This will give you a list of all of your family members with the same last name. That relation contains all of details (rows) of each person (row) you are related to. What that means is that the contents of a relation are not just one piece of information (column), it’s the entire row.

What I’m getting at, is that the quickest way to know that you are related to someone is by having the same last name. That’s your relation. Once you have your relation, then you can determine their first name or their address by using a Lookup to find a specific column. Or you can just use an inline list to display any pieces of information from that relation.

Like @shchc mentioned, what shows in a relation column is mostly irrelevant. It just shows you that a match was found based on the columns you chose to match up. There is no way for a relation to predict what you want to see or what you want to use it for, so it just picks a column value to show you. Also, it would be overwhelming if a relation column showed the entire contents of a row, especially if you have 10’s or 100’s of columns in each row.

4 Likes