Display data from related record in table

Hey,

I am currently testing “weweb”. Unfortunately I can’t get it to show me related data in a table. I tried the lookup function, but somehow it doesn’t work with that either, or I’m doing something wrong.

Example:

I want to create a table from my collection “Contract”. In one column the corresponding “insurer name” should be displayed. The collection “Contract” contains the field “insurer id” to create the relation to the collection “Insurer” which contains the field “insurer name”.

How do I get the insurer name of the related record displayed in my table?

Hi @Sebastian,

You need to create two Collections in WeWeb. One with the contracts, and one with the insurers.

Then, if you’re working with the “Contract” collection on one page, you will be able to lookup the “Insurer” collection as well.

In the example here, we have a collection with a list of tickets in our public roadmap:

and a collection with a list of tags like “New feature”, “Bug”, etc.

This enables us to lookup the list of tags of a specific item in the list of tickets.

Does that help?

If not, feel free to share a link to your project and/or record a short loom to walk us through what your project.

Hey Joyce, I’m wrestling with a similar problem and not following your explanation here. I see in the documentation it says to use binding depth to set up the relationships between fields so you’ll be able to link related fields like you show in the linked example above. But I’m not using Airtable, instead Xano. How do you set binding depth between two tables from Xano?

@Aloy there are several ways that you can do this. With Xano, if you want to handle it in the database, you can use addons.

Take a look at the post below. It may help. If not, let me know and I can get more info to you on how to set up.

1 Like

Hi @Aloy :wave:

Were you able to figure this out?

To follow up on Kevin’s answer, you indeed have two options:

1- use Add-Ons in Xano so that your one Collection in WeWeb includes all of the information you need. This is the best option if the data you want to add on doesn’t make the Collection too big and you will probably not need this information elsewhere.

2- create two Collections in WeWeb, one for each of your Xano tables, then use the lookup or rollup no-code formulas to “link” the two in the frontend. This is the best option if you will be using data from each table separately on other pages because you don’t want to load the same data twice (once with a collection that has add-ons and once with a dedicated collection)

Not sure if this makes more sense :sweat_smile:

Let me know if not!

Otherwise, this is a bit of a long tutorial (21 minutes) because I wanted to show a real use case (how we built our public roadmap page in WeWeb) but I think it’s worth a watch (even at 2x speed!) for an introduction to some of the most helpful no-code formulas in WeWeb.

Thanks Joyce. I responded early that Kevin’s suggestion #1 was perfect. Doing it on the Xano side worked terrific to get the data I needed into Weweb.

I am still wrestling with presenting that data properly (eg updatable date fields in a data grid, etc) and with updating data back into xano, particularly when the data is a list of linked records from a related table. But I think that is just me needing to spend more time on it.

1 Like