Working with relations and rollup values based on relations

Hello I have a problem with relations:

I have several tables with printed values that I set when Users submit the forms:

Users: with HorseSchoolID (1:1), relation with HorseID (1:n) and with Lessons (1:n)

Horse School: relations with UsedID (1:n) and HorseID (1:n)

Horse School Details: basically what’s inside a stable, the types of field and so on, printed values of Horse School ID (1:1)

Lessons: here I want the users with role “instructor” to create lessons that users can book. Every lesson should then be associated with HorseSchoolID (1:1, done), CreatorID (1:1, done) and HorseSchoolDetaildID (basically the field where it will take place…here I have a problem since the user cannot - of course - select a code in a form so I don’t know how to create this relationship).

Can someone help with that issue?

Have you tried a choice component? You would need a human readable column for the choice component ‘display’ and use the horseschoolDetailID for the ‘values’

I have done that but I don’t like it very much. It can occur that the data is duplicated in that way. Even if I set conditions in the choice form (imagine if there are 2 field of the same type with same details and only a different rowID)

Well I don’t know your app but if you are having duplicate data then there might be a more efficient way to setup your tables.

No ok I misunderstood your suggestion, now it works well. Last question though…if I want to display the ID related value in a component how do i do that as I don’t have the chance to select it…

1 Like

That depends on where you are trying to display the related value… if you are trying to display it in a Native form then I don’t think that will work.

You could use a custom form which essentially is a 1 row table with a bunch of user specific columns to hold all your inputs… from there it would be easy to setup the relation from your choice component.

The disadvantage to a custom form is that it can cost many updates.

1 Like

Nice job on this solution, @Eric_Penn. Both are accurate:

  1. Use a choice component with different value/display fields
  2. Use a custom form to display related data.

Here’s an alternative to number 2 as long as there are no calculations involved:

3 Likes

Thanks @Robert_Petitto! Nice touch with the form container, seems like a great use case!

Feel free to ask questions. There are many people willing to help

No sorry I mean to display the relationship in a table component. Now I have all the IDs and the relations/lookup in place and I see the data in the data section but when I want to display them I am not able to select them in a table/data grid component.

How can I work around this issue?

If I understand correctly you want to go into the settings of that component and under DATA use your relation for it’s ‘Source’

Is your lookup showing as an array? It may be because your relation is a multiple relation instead of a single relation. Unless I completely misunderstood the problem.

2 Likes

Hi, no it’s not a multiple relation, it’s a single one.
I cannot understand why it doesn’t show…

And it’s like that for every relation, being single or multiple…I’m using glide as data source

Are you trying to use a relation column as an item in a Data Grid?
You can’t do that - what would you expect to see?
If you want to use column values from the table that the relation is matching to, then you’ll need to add one or more lookup columns, and use those.

4 Likes