How to display images in forms according to the values selecting by users in a enum(dropdown)?

Hi everybody,

This is my first time building an app in Appsheet. I have solved most of my questions by reading things in this forum, along with studying using the articles of the Help Center. However, no luck so far with this issue

I would want to display images in my form depending of the user input. I am aware of the Static image in form method. In fact, I tried to put a LOOKUP() expression in the Content property of my Show column (instead of a static name/URL) for search the required image, but it did not work.

Below, there is a screenshot of what I am trying to achieve. I would be very grateful if anyone could point me in the right direction.

Solved Solved
1 7 1,769
  • UX
1 ACCEPTED SOLUTION

Use a Content expression that chooses the appropriate image. For example:

SWITCH(
  [Product],
  "Product A",
    "Images/Product A.jpg",
  "Product B",
    "Images/Product B.jpg",
  ...,
  ""
)

See also:

View solution in original post

7 REPLIES 7

Hi @Dedoxtech

How about making the item selected by the button Ref, and displaying the master Image with the initial value?

3X_d_0_d079e6cc71e8916cd1f0dce334aa8d07f450ebd6.gif

Or use a column of type Show and Category of Image.

Hello @Steve

Maybe I mixed up some terms in my initial post, but I think this is the approach I was using earlier with no luck

Below there is a screenshot of my colum of type Show and Category of Image. In my initial post, I manually changed the Content to illustrate my goal

Could you please guide me a little bit about how to make this method works?

Regards

Use a Content expression that chooses the appropriate image. For example:

SWITCH(
  [Product],
  "Product A",
    "Images/Product A.jpg",
  "Product B",
    "Images/Product B.jpg",
  ...,
  ""
)

See also:

The answer is not clear enough. I'm trying to do something similar but I get this error: "SWITCH function is used incorrectly: Inputs to SWITCH() must be an initial expression, one or more value-result pairs, and a default result"

Thank you for your suggestion sir,

I will try to implement it in my app and validate if my users are ok with this setting

Regards

Hello everybody,

It has been busy weeks for me. Thank you so much @Steve, your solution works as expected.

For future readers, I would like to add that we need to unckeching the toggle for โ€œRequire Image and File URL Signingโ€, for being able to use this expression.

3X_7_0_70263ec717c96f902fe2ae2db13dbfd26307aa7f.png

At the end, I decided to switch to a CONCATENATE() expression:

CONCATENATE(โ€œImagenes/โ€, [Product], โ€œ.jpgโ€)

This allow me to manually generate the URL of the image in a easier way, because I have a high number of products (not just two).

Regards

Top Labels in this Space