Good day, I am having some trouble with the l...

Good day, I am having some trouble with the lookup function.

Let me explain a bit more. I have a form that allows the user to enter data, the criteria I want the lookup to take into account is called “Diagnosis”. Then below that I have an Image field that should display an image based on the "Diagnosis performed. The “Diagnosis” field is a list that the app gets from the same sheet as where the image is.

I get expression valid but nothing is displayed.

=LOOKUP([Diagnosis], “Diagnosis and Treatment”, “Diagnosis”, “Standard Treatment Guide”)

The first [Diagnosis] is the form selection, correct? Then “Diagnosis and Treatment” is the sheet name where the Diagnosis list comes from as well as where the images are kept. Then the last “Diagnosis” in my expression refers back to the list?

And lastly the “Standard Treatment Guide” refers to the column name where the images are.

Did I make a mistake somewhere?

Try with… LOOKUP([_THISROW].[Diagnosis],Diagnosis and Treatment,Diagnosis,Standard Treatment Guide)

@Aleksi_Alkio I copied the expression you gave but I still don’t get the image to load, also no errors.

Which value are you looking for? Text or image?

What I want to get is an Image based on what “Diagnosis” is selected, I converted some PDF pages to images and want to show the specific image when that diagnosis is selected. Currently I only have 1 image as a test in the sheet.

The problem with the image is this… because you are using the EnumList as a source, you should bring multi images but you have field only for one image. If the user can choose as many options as he/she wants, you should have image fields for all options.

But wouldn’t it just show at least image then?

Example… user chooses 5 options from the dropdown, you should have 5 different image or show columns to show those 5 images. If you have only one image column, it will show only the first image.

Yes that is correct, but I am not winning with the lookup function, it’s probably something simple that I am missing

So… are you saying the first image would be enough?

Yes I will add extra image fields if or when I get the lookup function to work like I want. For now just getting the correct image to display for what diagnosis I select is all I need

Just an update on my progress, I am now able to hav the image load from my lockup but it is static, so no matter what I select it stays that one image, I know I only have one image in my sheet at the moment but when I select something else that doesn’t have that image associated with it it should remain blank, no?

What’s the formula?

What is the app name and account ID? I can check the reason quickly if it’s okay for you.

#ERROR!

I used the one you gave and removed “[_THISROW]” because it was giving me the wrong return value

You both fields seems to be EnumLists… Diagnosis and Illness. Are you trying to verify these two fields so when they match, show the image?

What do you mean by both? There should only be one and that is “Diagnosis”. The diagnosis must select a corresponding image from my sheet.

In your “Diagnosis and Treatment” table you have the Illness column and that field contains the same Enumlist values as Diagnosis field might have. For example Illness: Abdominal pain. If these fields would be Enum, your lookup formula should like this…

LOOKUP([_THISROW].[Diagnosis],Diagnosis and Treatment,Illness,Standard Treatment Guide)

I don’t use illness as a part of the form, I only use that to make up the enumlist of Diagnosis, if I use your formula then no image is retrieved