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

expressions
(Jonathan Fraser) #1

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?

(Aleksi Alkio) #2

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

(Jonathan Fraser) #3

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

(Aleksi Alkio) #4

Which value are you looking for? Text or image?

(Jonathan Fraser) #5

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.

(Aleksi Alkio) #6

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.

(Jonathan Fraser) #7

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

(Aleksi Alkio) #8

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.

(Jonathan Fraser) #9

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

(Aleksi Alkio) #10

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

(Jonathan Fraser) #11

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

(Jonathan Fraser) #12

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?

(Aleksi Alkio) #13

What’s the formula?

(Aleksi Alkio) #14

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

(Jonathan Fraser) #15

#ERROR!

(Jonathan Fraser) #16

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

(Aleksi Alkio) #17

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?

(Jonathan Fraser) #18

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.

(Aleksi Alkio) #19

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)

(Jonathan Fraser) #20

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