Display image based on status

I am creating a system of badges in which the Name of the badge, and it’s description, is always visible within a grid but the actual badge image changes based on status.

  • Badge earned: See the badge in full color (call this ImageA)
  • Badge not earned: See a greyed out version of the badge (call this ImageB)

Using the wonderful advice offered in the following thread, Display Hero Icons as images in List view based on condition - #15 by Jeff_Hager, I was able to make it this far.

Two Glide sheets are being used

  1. Users to tap into the Row Owners feature so that people see their individual badges
  2. Badges to contain badge name, description, and image. Each badge has two rows (one with image in full color, one will greyed out version)

So far, the following works

  • A boolean field (“I See You”) captures if an action has been completed in order to earn the badge.
  • An If Then Else columns checks the boolean field to determine which row in the Badges sheet is relevant. In this example, if ‘I See You’ is checked, then refer to row 1 in the Badges sheet. If ‘I See You’ is not checked, refer to row 18 in the Badges sheet.
  • A BadgeRelationStatus column uses the ITE column to return the appropriate badge image.

Then…I’m stuck. My plan was to use the Fields component to display the badge image and description but it appears that Relation columns are available to the Fields component.
Does anyone see a way to finish this? My goal is to be able to show all of the badges available but have the badge image change when the badge is earned.

Thank you

Assuming your badge relation status is a ‘SINGLE’ relation… add a lookup column via badge relation status and retrieve the badge image

The fields component doesn’t support images but there are plenty of other components that do. Use your new lookup column in one of those and that should work

We are definitely getting closer…that worked!
Thank you

The new challenge is that I have 10 badges. After using the LookUp column to display the badge in either full color (earned) or greyed out (not yet earned), all of the badges are identical to the first one.

Do you recommend a type of query to have each of the 10 badges uniquely match their earn status? An example would be appreciated.

I’m not sure I understand this. As long as your ITE column returns the right number to later on be used in the relation, I assume it would work?

It works in the Data Editor. The columns are pulling in the correct badge.

I’m missing something about how to inform the Builder on which image to choose.
Currently, the Badges collection shows the default list of all possible badges from the ‘Badges’ sheet.

In the data, I have a Template column that joins the rows (from the Badges sheet) that are associated with the appropriate badges.
Ex: if something is true, then pull row 1. If that thing is false, pull the data from row 18.

How do I point the ‘Image’ field within the Grid collection component to the Template column that contains the correct images?

Background images that may be helpful include:
Badges sheet

This is being built using two initial badges with a status. Once this works, I will build out columns for the other badges.
Template column to join ITE columns for two badges

An example of an ITE that the previous screen shot pointed to is shown below. The number “2” or
“19” in these examples corresponds to a badge row in the Badges sheet.

I tried several variations on how to get this to work. Some of these columns might be helpful even though they aren’t currently being used. You can see these columns are pulling in the correct images. I’ll delete anything not needed once we get a working system. Since I want to show a Badge Name, Badge Description, and an image (full color when earned or grey when not yet earned)…I’m stuck somewhere.

Without studying this thread too thoroughly, I think what you ultimately need is a comma delimited list of all earned and unearned badges for each user. Then used a split text column to split it into an array. Finally create a relation linking that array to the badge table. Then you can display the collection for each user sourced from the relation.

this also seems really close but something is off.

Here is what works
:white_check_mark:have a comma delimited list of all earned and unearned badges
:white_check_mark:have a split text column that splits it into an array
:white_check_mark:have a relation linking the array to the badge table


the relation column (the final check mark) does not appear in the drop down list for ‘Image’ in the grid collection component. I tried using the User table as the data source and also the Badges table as the source of the collection. Neither offered the relation column. The relation column should appear just under the ‘Array Badges’ option in the dropdown.

May I ask for ideas on what I am missing?

I haven’t read this entire thread, but shouldn’t you be using the multiple relation column as the source of the collection?

At this point, I have created so many column types and tested so many options that I no longer trust my own eyes :slight_smile:
For the source, I can point to a sheet.
Where do I point to a specific column?

The relation column does not appear as an option for the image within the component.

If your screen is attached to the same table, then it should be an available choice.
Open the Source list and scroll all the way to the bottom.

1 Like

I am literally crying with laughter.
You solved it!

Thank you to you and the entire community. It took a village to help me with this one.
Kindest regards

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.