Image help (sorry in advance)

I’ve been combing through the internet for help on this for the past couple hours. I’m sure it’s been discussed but I can’t find it. With that said…

I am having trouble porting images with a choice component.

Let’s say you want someone to pick their favorite NFL team.

You have the AZ Cardinals (first alphabetically) in one column and a URL link to their logo in the second column - this is the source data.

You create a form that shows the team names with the logos for the user to click. Rather than having the user type in names and the like, you set them up as chips using a choice component. You would have 32 cards with a small circle holding the logo on the left followed by the team name.

The problem I’m having is that the choice component only writes to one column, like the team name, leaving the logo behind. It looks like you can’t write to the second column, which makes sense but I’m having trouble solving the problem.

I understand the concepts behind the lookup and relation functions. Neither of them delivers the correct result - I get a column with both the name and logo or all the logos, which cannot be displayed as the image for the choice the user makes.

So, I’m sure this is user error. On the other hand, I’ve rebuilt the page 4-5 times to try to fix it and can’t get there. Any help would be appreciated.

Thanks in advance!

The value you write should be a unique value for the team – for example, a Row ID. Then add a relation column to turn that unique value into a relation back to the full team row, and finally you can use lookups to pick any other values you want from the relation.

I made you a template demo: Choose one

2 Likes

Thanks for the suggestion and I have done this multiple times. As an example, I have the row IDs for two teams:

Teams Page:
ID Column “Name” Column “Logo” Column
Row ID 1 AZ Cardinals URL for logo
Row ID 2 Denver Broncos URL for logo

I use the form I created and I choose the AZ Cardinals. The ID is used to fill the ID column on the “user Submission” page but the names and logos are displayed as normal on the app.

User Submission Page:
ID Column Relation Column (ID from teams) Lookup Column (name from teams)
Row ID 1 AZ Logo and “AZ Cardinals” “AZ Cardinals” and “Denver Broncos”

The title choice on the app is the ID, which is the only choice I have other than two audit columns I built that are “hidden.” All of this makes sense and matches with the concepts I have from excel but the result is not correct. The lookups are not pulling the wrong information on nill, so it feels like I’m not off on the execution (by much) which is probably the most frustrating part. When the answer you get isn’t even on the test at least you know you’re way off.

Can you provide a screen shot of your tables from the Glide Data Editor please?

Sure thing, here they are:

and the choice component for reference:

better one

Your Lookup is not referring to your relation. I think you have it pointing to the whole table instead of the relation.

1 Like

Exactly :point_up:

Fair point, thank you. But when I change that I still end up with the same result in the columns and my options on the app layout are the same.

Is your relation a single or multiple relation?

It should be a single, but looks like you have a multiple relation.

I think it is single. I have not checked the “multiple” box.

My understanding is that the first column is the ID. The second column basically says I want to look up the ID in Team Table. The third column says when you find that value in Team Table find me the “name.” It is really easy to logically figure and I can do it in excel in 30 seconds. That is probably what is tripping me up the most - the change in language and logic :frowning:

to wit

The fact that your lookup column is returning a single element array (I can tell that by its appearance) indicates that the relation must be a multiple relation. Please double check it.

oh, wait - your lookup still isn’t correctly configured. You’re referring via the table, instead of directly to the relation.

Look for something like this:

2 Likes

I think you are still referring to the entire table and not the relation. When you select a relation, you should be able to select a specific column from the related row. Seems that you are returning the relation itself.

1 Like

oh man, that’s it!! I didn’t even see that option. What a relief. Thanks so much to both of you!!!

2 Likes

Success!!!

1 Like

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