Help needed to form a "word of the day" app

I don’t see a lookup column in your screenshots. Only the relation column. If you need a lookup column, then you should add one that points to the relation. Also, make sure the relation is a single relation as opposed to a multiple relation.

Hi, Thanks I’ll try it out and revert.

@Jeff_Hager

today’s word is the look up column that pulls the word for the day and uses count (day count that is )<> sno to pull that word into the Users table. The relation is single.

Is this what you are saying or am I misunderstanding your question?.
What I need is a method to display the word of the day , apple, in the column today’s word either as a text field or as a label on a button. Basically to display it in a nice way.
Thanks !

I’m saying that your screenshots only show a Relation column. I don’t see a Lookup column anywhere on your screenshots.

Relations pull back entire rows of data. Lookups pull back a single column from that relation.

@Ap_Seh - it seems that you have been struggling with this one, so I’ve put together a simple concept app (which is copyable) to help give you a bit of a kick start :slightly_smiling_face:

How it works:

  • In the Users table, there are two key columns…

    • Next Word ID: the ID of the next word that user will be shown
    • Word Last Seen: the date/time that user was last shown a word
  • There are also several computed columns in the Users table. Here is a quick description of each:

    • ite-next-word-id: this deals with an initial empty state of the Next Word ID column (if empty, then 1)
    • mth-next-word-id: this uses a math formula to ensure the next Word ID is an integer between 1 and 5
    • mth-next-word-at: this calculates the time that the next word should be shown to that user
    • hrs-till-next-word: this calculates the number of whole hours until the next word should be shown
    • mins-till-next-word: this calculates the number of minutes (minus hours) till the next word should be shown
    • hr/hrs & min/mins: these are used to deal correctly with the pluralisation of hours and minutes
    • tp-time-to-next-word: template column used to create the content to display in a hint component, showing how long till the next word is shown
    • ite-show-word: this contains the logic that decides whether or not to display the next word.
  • The words are displayed using an inline list, filtered by the Next Word ID

  • You’ll also see that most components have visibility conditions, using the state of the ite-show-word column

  • The “Got It” button does two things:

    • Increments the Next Word ID column for the user by 1
    • Sets the Word Last Seen column to the current date/time
  • Once the user clicks on the “Got It” button, both the word and the button will be hidden, and replaced with a hint component that shows how long until the next word is shown

  • The “reset” button is there so that you can simulate the next word in the list being shown

Let me know if you have any questions.

3 Likes

You can never make a lookup column point to a relation, though You can make a relation point to a lookup column. A lookup is the product of a relation, not the other way round. Hence you make a lookup column “relate back to” a relation and a relation “point to” a column.

Sorry @Darren_Murphy because of Jeff’s poor choice of words, you had to build an app from scratch :joy::joy::joy:

1 Like

Jeff always chooses his words very carefully :grinning:
And his choice of words had nothing to do with my decision to build the app. I just did it for the practice :joy:

1 Like

You didn’t get the joke :joy:

1 Like

I did, but I chose not to acknowledge it :stuck_out_tongue: :rofl:

1 Like

No still don’t get the joke so stop pretending :rofl::rofl:

1 Like

I’m not sure I understand what you are saying. A relation is not a lookup of a single column. Yes it uses a single column in one sheet to link to a single column in another sheet, but it’s still a link to an entire row. The only way to pull out a single column value from a relation is to use a lookup column that references that relation.

That’s the point I was trying to make to @Ap_Seh is that they have a relation column but I believe they were calling it a lookup when it isn’t a lookup and doesn’t function like a lookup. You can’t set a value in a component from a relation, because a relation is not a single value…it’s a row or multiple rows. If they add a Lookup column and point it to the relation column, then they can pull the word of the day out of that relation and set the component value to that lookup value.

Looking at the screenshots I did not see a lookup column, so I can only assume that there isn’t one. Yes, the my wording is a little vague, but I like to make people think a little bit and ask follow up questions if they still don’t understand something. Just telling someone to add a Lookup column may not heIp them fully understand why they need to do it. If they have to think about what I’m saying or asking, then it’s helps them to better understand how everything works together in the future.

“…teach a man to fish…”

This is actually a good illustration:

3 Likes

@Darren, Thanks ! I have been trying to figure out your logic in the app. Lots to learn from it. I’ll take my time and revert if I am unable to understand something.

Thanks again.

@Wiz Thanks. All I really wanted to know was that why isn’t the relation / lookup column displayed as a field / option in the data (of say inline list )where I can choose it, like other columns, to display its value.

I think since it does not provide the relation column in the data of the components, it would mean that displaying those values is not allowed. I am just not sure and so wanted to know it. I still really don’t know.

Thanks.

This I think is what I was really asking. I was thinking that since I am using the count value to lookup the word by relating the count value in Users to sno value in words, that it is a lookup but seems it’s a relation and so cannot be used to display it’s value.

So may I ask how I can instead use a lookup that I was trying to create and instead ended up creating a relation field?

Thanks.
P.S. I know Darren has been great in doing a whole app for me but I still would like, if possible, an answer to the above. The I would be able to create and use my lookup field and not a relation field, to display the value and complete my app immediately.

Thanks loads !

https://docs.glideapps.com/all/reference/data-editor/computed-columns/lookup-column

Relations and Lookups work in combination. You are already half way there and already have the relation, so you just need to add a lookup column.

1 Like

:fish::tropical_fish::flags:

1 Like

Hi Darren,

I have understood this to quite an extent. Could you please explain what does this hint template achieve.


[data-test=‘app-hint’]{
white-space: break-spaces;
}

Another thing I cannot figure out is how / where you managed to set the text height of the word in the tile to be as big as it shows up. The inline list allows for me to set the text size to only 3 sizes, small , medium and large. but I am using the free version of glide. The largest value, in my case, sets the height to about half your size.

Thank.

This is just a CSS trick to make the text in the Hint component a bit more presentable. It causes the line-breaks to be respected. If you remove it, you’ll see the change in the Hint component.

The title text is shown inside the tile because the “Show Title when Image is not available” option is selected. As far as I’m aware, you can’t change the style of that (except maybe with CSS).
Screen Shot 2021-02-24 at 11.09.00 AM
Changing the text size only affects the Title/Details text that is shown below the tile.

1 Like
[data-test=‘app-hint’]{
white-space: break-spaces;
}

This allows your hint text to be separated into paragraphs. If you don’t use this, the native hint text will group them all into one paragraph.