Why are some computed columns not available in the text component?

Hi everyone!

I’ve been working on a multi-page app and learning a lot - thank you to everyone who’s helped so far!

Right now I’m building a feature where a quote is displayed based on user’s selected mood (there are 5 moods in total) I’m using a rating component to represent mood, then using:

  • a relation column to match mood to a set of quotes
  • a single value column to pick one quote from that related list
  • a lookup column to pull the quote text

The logic seems to be working - in the Data view I can see that the relation, single value, and lookup columns all show the correct values.

But the problem is:
In the Layout / Component panel, when I try to display the quote using a Text or Rich Text component, none of those columns (relation/ single value/ lookup) show up as options to select. They are just missing.

Is this a context issue? Do I need to filter the screen differently, or restructure my setup? I’m currently using the Users table as the screen’s data source

Here’s a screenshot of the column names,
glide screenshot 5

Thanks in advance - I really appreciate your help :folded_hands:

Relations are links to a single or multiple related rows. They do not represent a single column in those related rows.

First question would be if your relation is a single relation or multiple relation.

Next question, why do you have both a Single Value column and a Lookup column? You should only need one or the other to pull a value from a relation. Usually a Lookup is the common choice.

If you have a multiple relation, then a lookup column would return an array, which could have multiple values. Arrays can’t be used in places that only accept a single value.

However, a Single Value column would always return a single value, except when you are using it to retrieve an existing array, or you are using it to return an entire row.

I think it would be a lot more useful to see how you configured each of those three columns. That will provide a whole lot more context.

1 Like

Here is what I did, I first use a relation column to relate the mood rate to a column with mood numbers, and there are multiple quotes with one mood number, and I want that, so the single value can pick one of the few quotes randomly from it each time:

And then I plug the single value column to the relation, but weirdly it returns all the quote instead of only display one random quote, here’s my configuration:

then because both the relation and the single value doesn’t show up as an option for the text I want to display, I used a lookup to try to display a quote, but sadly the lookup also didn’t show up:

This is what is happening, is there a way to fix this?

Ok, I see your logic now, although it’s a little bit of a roundabout way to get there. Based on a quick test it should work, unless your screen is not looking at the correct table. Or for some reason your lookup is returning an array, but your screenshots don’t show that, so I can’t say for sure.

Regardless, I think I would take a different approach and use a Query column with the appropriate filter, sorting, and set to return a single row. Then point a Lookup column at that query.

2 Likes