How to use a lookup as image source in an 'add' form

Hi folks

So it looks like I’m able to use a lookup column as a source for images in some areas, with one exception I’ve noticed being when in an ‘add’ form.

Can someone please help shed some light on how I might be able to do this? :slight_smile:

Is there a way, for example, to refer to an image which is linked directly to that User e.g. from the user table?

Here’s a screenshot of the relation & lookup in the table which items are being added to - I presume the ‘add’ form doesn’t know which image to use, so it doesn’t display any of the images if I select ‘companion image’ as a source.

So do you mean you want to display a lookup image in an image component, inside an “add” form?

Is this add form the top-left button on a list screen, or a form button?

Correct :slight_smile:

And yep, this is the add form from the top-right button on a list screen.

I assume the lookup above is stored in your user profiles table, and you can refer to that column in the image component, but that does not work (i.e showing the image in the form)?

Actually, I did a test with this earlier. It seems that if the form is triggered from the plus (+), then you don’t have access to User Profile values when adding components to the form screen. But if it’s triggered via an Add Form button, then you do. I’m not sure what the difference is, you’d expect if they’re available in one, then they’d also be available in the other :thinking:

Just thinking about it a bit more, I guess the difference is with an Add Form button, you’re starting from a Details screen, which means that you’re already attached to a row. But when you trigger an Add Form from a List Layout using the plus (+), you are not actually attached to any row. Maybe that’s what makes the difference? Curious to know what @Jeff_Hager thinks about this…

1 Like

Exactly what Darren’s mentioned - unfortunately it looks like I don’t get the option to refer to the user profiles table if I go via the (+) form.

It sounds like I may need to use an ‘Add Form’ button instead as a workaround…

But yep, curious to hear what Jeff has to say too.

If you use an Add Form button, then yes - you can refer directly to User Profiles values without any relations or lookups.

I’m not sure if it’s a bug or intended behaviour, to be honest.

Hmmm, I’d have to play around with it, but I think that I would end up with the same conclusion as @Darren_Murphy (last day of vacation :wink: )

Yeah, I would have expected user profile values to be available for components. Maybe it was just never added as an option to the Add Screen. I can’t think of any technical limitations that would prevent the Add Screen from having user profile derived components, while allowing other screens to have components using user profile values. Obviously the Add Screen has no attachment to an underlying row, which makes it unique in itself, so maybe it was just a missed opportunity for glide to add the option to derive components from user profile values, since it’s kind of unique in its own way.

Personally, I never use the native Add screen or the list layout styles. I always prefer detail style layouts, with an inline list, and adding my own Add button (usually a floating buttons with a plus symbol). Just gives me more flexibility in the long run.

3 Likes

Interesting thing… if you use a text type component instead - a hint component for example - then you get access to User Profiles values in both cases. I did pose the question in Slack (#experts) and got a response from Mark. It seems that the Image component is somehow special in this case, although I’m still a little confused :crazy_face:

3 Likes

Hmm, I have to take a look at the Slack.

Thank you for the inputs all, it’s really appreciated! For now I’ll go with the ‘detail’ layout with inline list etc approach that Jeff suggested - it does sound like a better option anyway :smiley:

2 Likes

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